Files
Etienne PerotandgVisor bot 726ebd533d Runtime tests: Add flakiness detection and per-test timeout options.
This adds flags and env variables for the following settings to runtime tests:

- `per_test_timeout`: A per-test timeout which can be shorter
  than the batch timeout. Useful to cap the duration of tests
  which flake by getting stuck (as is the case for
  `bug60120.phpt`)
- `runs_per_test`: Number of times to run each test (useful to
  detect flakes).
- `flaky_is_error`: Controls whether a flaky test is considered
  passing or failing for batch error code purposes. Useful when
  either diagnosing a flaky test, or diagnosing a
  consistently-failing test while bypassing flaky others.
- `flaky_short_circuit`: If a test is found to be flaky, declare
  it as such immediately, rather than waiting for the rest of the
  `--runs_per_test` to finish. Speeds up bisecting flaky test, at
  the cost of flakiness percentage accuracy.

PiperOrigin-RevId: 466791296
2022-08-10 14:50:32 -07:00

37 lines
997 B
Go

// Copyright 2019 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package lib
import (
"flag"
"os"
"testing"
)
var excludeFile = flag.String("exclude_file", "", "file to test (standard format)")
func TestMain(m *testing.M) {
flag.Parse()
os.Exit(m.Run())
}
// Test that the exclude file parses without error.
func TestExcludelist(t *testing.T) {
_, err := ExcludeFilter(*excludeFile)
if err != nil {
t.Fatalf("error parsing exclude file: %v", err)
}
}