Skip to content

Commit 93f5299

Browse files
committed
test: Increase timeout and add log message
1 parent 3ce11c3 commit 93f5299

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

xtask/src/test_runner.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ impl TestRunner {
268268

269269
// If still running, kill it
270270
if !terminated_naturally {
271+
log::warn!("{test_name} test timed out after {timeout:?}, terminating process");
271272
let _ = child.kill();
272273
let _ = child.wait();
273274
}
@@ -408,7 +409,7 @@ impl TestRunner {
408409
self.run_simple_command_test(
409410
&["board-info"],
410411
Some(&["Chip type:"]),
411-
Duration::from_secs(5),
412+
Duration::from_secs(10),
412413
"board-info",
413414
)
414415
}
@@ -436,7 +437,7 @@ impl TestRunner {
436437
part_table,
437438
],
438439
Some(&["espflash::partition_table::does_not_fit"]),
439-
Duration::from_secs(5),
440+
Duration::from_secs(10),
440441
"partition too big",
441442
)?;
442443

@@ -540,7 +541,7 @@ impl TestRunner {
540541
self.run_simple_command_test(
541542
&["list-ports"],
542543
Some(&["Silicon Labs"]),
543-
Duration::from_secs(5),
544+
Duration::from_secs(10),
544545
"list-ports",
545546
)?;
546547
Ok(())
@@ -562,7 +563,7 @@ impl TestRunner {
562563
self.run_simple_command_test(
563564
&["read-flash", "0", "0x4000", flash_output.to_str().unwrap()],
564565
Some(&["Flash content successfully read"]),
565-
Duration::from_secs(5),
566+
Duration::from_secs(10),
566567
"read after erase",
567568
)?;
568569

@@ -586,14 +587,14 @@ impl TestRunner {
586587

587588
// Test unaligned address (not multiple of 4096)
588589
let mut cmd = self.create_espflash_command(&["erase-region", "0x1001", "0x1000"]);
589-
let exit_code = self.run_command_with_timeout(&mut cmd, Duration::from_secs(5))?;
590+
let exit_code = self.run_command_with_timeout(&mut cmd, Duration::from_secs(10))?;
590591
if exit_code == 0 {
591592
return Err("Unaligned address erase should have failed but succeeded".into());
592593
}
593594

594595
// Test unaligned size (not multiple of 4096)
595596
let mut cmd = self.create_espflash_command(&["erase-region", "0x1000", "0x1001"]);
596-
let exit_code = self.run_command_with_timeout(&mut cmd, Duration::from_secs(5))?;
597+
let exit_code = self.run_command_with_timeout(&mut cmd, Duration::from_secs(10))?;
597598
if exit_code == 0 {
598599
return Err("Unaligned size erase should have failed but succeeded".into());
599600
}
@@ -602,7 +603,7 @@ impl TestRunner {
602603
self.run_simple_command_test(
603604
&["erase-region", "0x1000", "0x1000"],
604605
Some(&["Erasing region at"]),
605-
Duration::from_secs(5),
606+
Duration::from_secs(10),
606607
"erase-region valid",
607608
)?;
608609

@@ -615,7 +616,7 @@ impl TestRunner {
615616
flash_output.to_str().unwrap(),
616617
],
617618
Some(&["Flash content successfully read"]),
618-
Duration::from_secs(5),
619+
Duration::from_secs(10),
619620
"read after erase-region",
620621
)?;
621622

@@ -660,7 +661,7 @@ impl TestRunner {
660661
self.run_simple_command_test(
661662
&["write-bin", "0x0", pattern_file.to_str().unwrap()],
662663
Some(&["Binary successfully written to flash!"]),
663-
Duration::from_secs(5),
664+
Duration::from_secs(10),
664665
"write pattern",
665666
)?;
666667

@@ -677,7 +678,7 @@ impl TestRunner {
677678
flash_output.to_str().unwrap(),
678679
],
679680
Some(&["Flash content successfully read and written to"]),
680-
Duration::from_secs(5),
681+
Duration::from_secs(10),
681682
&format!("read {len} bytes"),
682683
)?;
683684

@@ -704,7 +705,7 @@ impl TestRunner {
704705
flash_output.to_str().unwrap(),
705706
],
706707
Some(&["Flash content successfully read and written to"]),
707-
Duration::from_secs(5),
708+
Duration::from_secs(10),
708709
&format!("read {len} bytes with ROM bootloader"),
709710
)?;
710711

@@ -838,7 +839,7 @@ impl TestRunner {
838839
app_bin.to_str().unwrap(),
839840
],
840841
Some(&["Image successfully saved!"]),
841-
Duration::from_secs(5),
842+
Duration::from_secs(10),
842843
"save-image C6 regression",
843844
)?;
844845

@@ -879,7 +880,7 @@ impl TestRunner {
879880
self.run_simple_command_test(
880881
&["checksum-md5", "0x1000", "0x100"],
881882
Some(&["0x827f263ef9fb63d05499d14fcef32f60"]),
882-
Duration::from_secs(5),
883+
Duration::from_secs(10),
883884
"checksum-md5",
884885
)?;
885886

@@ -892,7 +893,7 @@ impl TestRunner {
892893
self.run_timed_command_test(
893894
&["monitor", "--non-interactive"],
894895
Some(&["Hello world!"]),
895-
Duration::from_secs(5),
896+
Duration::from_secs(10),
896897
"monitor",
897898
)?;
898899
Ok(())
@@ -903,7 +904,7 @@ impl TestRunner {
903904
self.run_simple_command_test(
904905
&["reset"],
905906
Some(&["Resetting target device"]),
906-
Duration::from_secs(5),
907+
Duration::from_secs(10),
907908
"reset",
908909
)?;
909910
Ok(())
@@ -914,7 +915,7 @@ impl TestRunner {
914915
self.run_simple_command_test(
915916
&["hold-in-reset"],
916917
Some(&["Holding target device in reset"]),
917-
Duration::from_secs(5),
918+
Duration::from_secs(10),
918919
"hold-in-reset",
919920
)?;
920921
Ok(())

0 commit comments

Comments
 (0)