Skip to content

Commit 390be00

Browse files
committed
tools: add a watchdog timer in test_if_v_test_system_works.v to speedup the failure of stuck CI jobs
1 parent a88d0d6 commit 390be00

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmd/tools/test_if_v_test_system_works.v

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module main
44
// and that it exits with code 1, when at least 1 FAIL happen.
55
import os
66
import rand
7+
import time
78

89
const vexe = os.quoted_path(get_vexe_path())
910
const vroot = os.dir(vexe)
@@ -110,6 +111,12 @@ fn main() {
110111
defer {
111112
os.chdir(os.wd_at_startup) or {}
112113
}
114+
unbuffer_stdout()
115+
spawn fn () {
116+
time.sleep(30 * time.second)
117+
eprintln('>>> exiting due to an expired watchdog timer <<<')
118+
exit(1)
119+
}()
113120
println('> vroot: ${vroot} | vexe: ${vexe} | tdir: ${tdir}')
114121
ok_fpath := create_test('a_single_ok_test.v', 'fn test_ok(){ assert true }')!
115122
if check_ok('${vexe} ${ok_fpath}') != '' {

0 commit comments

Comments
 (0)