FS tests: include preparation steps in timeout
Stop hangs caused by faults during mounting and file loading
This commit is contained in:
parent
d96a3373a6
commit
fa7ffd6ccc
1 changed files with 14 additions and 9 deletions
|
|
@ -971,8 +971,22 @@ let capture = "";
|
|||
let next_trigger;
|
||||
let next_trigger_handler;
|
||||
|
||||
function start_timeout()
|
||||
{
|
||||
if(tests[test_num].timeout)
|
||||
{
|
||||
test_timeout = setTimeout(() =>
|
||||
{
|
||||
log_fail("Test #%d (%s) took longer than %s sec. Timing out and terminating.", test_num, tests[test_num].name, tests[test_num].timeout);
|
||||
process.exit(1);
|
||||
}, tests[test_num].timeout * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function nuke_fs()
|
||||
{
|
||||
start_timeout();
|
||||
|
||||
console.log("\nPreparing test #%d: %s", test_num, tests[test_num].name);
|
||||
console.log(" Nuking /mnt");
|
||||
emulator.serial0_send("rm -rf /mnt/*\n");
|
||||
|
|
@ -1028,15 +1042,6 @@ function start_test()
|
|||
{
|
||||
console.log("Starting test #%d: %s", test_num, tests[test_num].name);
|
||||
|
||||
if(tests[test_num].timeout)
|
||||
{
|
||||
test_timeout = setTimeout(() =>
|
||||
{
|
||||
log_fail("Test #%d (%s) took longer than %s sec. Timing out and terminating.", test_num, tests[test_num].name, tests[test_num].timeout);
|
||||
process.exit(1);
|
||||
}, tests[test_num].timeout * 1000);
|
||||
}
|
||||
|
||||
capture = "";
|
||||
|
||||
tests[test_num].start();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue