Skip to content

Commit 340c902

Browse files
committed
[ci] add a 60s test timeout
According to [this log] and #2458, we seem to be timing tests out in a way that's quite concerning. Add a per-test timeout to see if this can be repro'd. [this log]: https://buildomat.eng.oxide.computer/wg/0/details/01JZVTRXR8AJWRZVDES5QK9J0K/esYopA09hCnsAeXx3gX7e5wdUJV5qOSWgyxvebirpHLEZVsy/01JZVTSDCJC5N7A41FAXAQX0WB
1 parent 798ef73 commit 340c902

File tree

7 files changed

+19
-15
lines changed

7 files changed

+19
-15
lines changed

.config/nextest.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ setup = "build-seed-archive"
2424
[profile.ci]
2525
# Don't fail fast in CI to run the full test suite.
2626
fail-fast = false
27+
slow-timeout = { period = "60s", terminate-after = 1 }
2728

2829
[profile.ci.junit]
2930
path = 'junit.xml'

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nextest-runner/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ pretty_assertions.workspace = true
147147
proptest.workspace = true
148148
test-strategy.workspace = true
149149
test-case.workspace = true
150+
tracing-subscriber.workspace = true
150151

151152
[[bin]]
152153
name = "passthrough"

nextest-runner/tests/integration/basic.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use test_case::test_case;
3535

3636
#[test]
3737
fn test_list_binaries() -> Result<()> {
38-
set_env_vars();
38+
test_init();
3939

4040
let graph = &*PACKAGE_GRAPH;
4141
let build_platforms = BuildPlatforms::new_with_no_target()?;
@@ -70,7 +70,7 @@ fn test_list_binaries() -> Result<()> {
7070

7171
#[test]
7272
fn test_list_tests() -> Result<()> {
73-
set_env_vars();
73+
test_init();
7474

7575
let test_filter = TestFilterBuilder::default_set(RunIgnored::Default);
7676
let test_list = FIXTURE_TARGETS.make_test_list(
@@ -116,7 +116,7 @@ fn test_list_tests() -> Result<()> {
116116

117117
#[test]
118118
fn test_run() -> Result<()> {
119-
set_env_vars();
119+
test_init();
120120

121121
let test_filter = TestFilterBuilder::default_set(RunIgnored::Default);
122122
let test_list = FIXTURE_TARGETS.make_test_list(
@@ -240,7 +240,7 @@ fn test_run() -> Result<()> {
240240

241241
#[test]
242242
fn test_run_ignored() -> Result<()> {
243-
set_env_vars();
243+
test_init();
244244

245245
let pcx = ParseContext::new(&PACKAGE_GRAPH);
246246
let expr = Filterset::parse(
@@ -340,7 +340,7 @@ fn test_run_ignored() -> Result<()> {
340340
/// Test that filtersets with regular substring filters behave as expected.
341341
#[test]
342342
fn test_filter_expr_with_string_filters() -> Result<()> {
343-
set_env_vars();
343+
test_init();
344344

345345
let pcx = ParseContext::new(&PACKAGE_GRAPH);
346346
let expr = Filterset::parse(
@@ -412,7 +412,7 @@ fn test_filter_expr_with_string_filters() -> Result<()> {
412412
/// Test that filtersets without regular substring filters behave as expected.
413413
#[test]
414414
fn test_filter_expr_without_string_filters() -> Result<()> {
415-
set_env_vars();
415+
test_init();
416416

417417
let pcx = ParseContext::new(&PACKAGE_GRAPH);
418418
let expr = Filterset::parse(
@@ -453,7 +453,7 @@ fn test_filter_expr_without_string_filters() -> Result<()> {
453453

454454
#[test]
455455
fn test_string_filters_without_filter_expr() -> Result<()> {
456-
set_env_vars();
456+
test_init();
457457

458458
let test_filter = TestFilterBuilder::new(
459459
RunIgnored::Default,
@@ -498,7 +498,7 @@ fn test_string_filters_without_filter_expr() -> Result<()> {
498498
; "retry overrides ignored"
499499
)]
500500
fn test_retries(retries: Option<RetryPolicy>) -> Result<()> {
501-
set_env_vars();
501+
test_init();
502502

503503
let test_filter = TestFilterBuilder::default_set(RunIgnored::Default);
504504
let test_list = FIXTURE_TARGETS.make_test_list(
@@ -663,7 +663,7 @@ fn test_retries(retries: Option<RetryPolicy>) -> Result<()> {
663663

664664
#[test]
665665
fn test_termination() -> Result<()> {
666-
set_env_vars();
666+
test_init();
667667

668668
let pcx = ParseContext::new(&PACKAGE_GRAPH);
669669
let expr = Filterset::parse(

nextest-runner/tests/integration/fixtures.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ pub(crate) fn ensure_execution_result(
154154
}
155155

156156
#[track_caller]
157-
pub(crate) fn set_env_vars() {
157+
pub(crate) fn test_init() {
158+
tracing_subscriber::fmt()
159+
.with_max_level(tracing::Level::DEBUG)
160+
.init();
161+
158162
// The dynamic library tests require this flag.
159163
// SAFETY:
160164
// https://nexte.st/docs/configuration/env-vars/#altering-the-environment-within-tests

nextest-runner/tests/integration/target_runner.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ fn runner_for_target(triple: Option<&str>) -> Result<(BuildPlatforms, TargetRunn
5050

5151
#[test]
5252
fn parses_cargo_env() {
53-
set_env_vars();
53+
test_init();
5454
// SAFETY:
5555
// https://nexte.st/docs/configuration/env-vars/#altering-the-environment-within-tests
5656
unsafe { std::env::set_var(current_runner_env_var(), "cargo_with_default --arg --arg2") };
@@ -188,7 +188,7 @@ fn current_runner_env_var() -> String {
188188

189189
#[test]
190190
fn test_listing_with_target_runner() -> Result<()> {
191-
set_env_vars();
191+
test_init();
192192

193193
let test_filter = TestFilterBuilder::default_set(RunIgnored::Default);
194194
let test_list = FIXTURE_TARGETS.make_test_list(
@@ -233,7 +233,7 @@ fn test_listing_with_target_runner() -> Result<()> {
233233

234234
#[test]
235235
fn test_run_with_target_runner() -> Result<()> {
236-
set_env_vars();
236+
test_init();
237237

238238
let test_filter = TestFilterBuilder::default_set(RunIgnored::Default);
239239

workspace-hack/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ target-spec-miette = { version = "0.4.4", default-features = false, features = [
4242
tokio = { version = "1.46.1", features = ["fs", "io-std", "io-util", "macros", "process", "rt-multi-thread", "signal", "sync", "time", "tracing"] }
4343
toml_edit = { version = "0.22.27", features = ["serde"] }
4444
tracing-core = { version = "0.1.33" }
45-
tracing-subscriber = { version = "0.3.19", default-features = false, features = ["fmt", "tracing-log"] }
4645
xxhash-rust = { version = "0.8.15", default-features = false, features = ["xxh3", "xxh64"] }
4746

4847
[build-dependencies]

0 commit comments

Comments
 (0)