ci: add a watchdog timer thread to ringbuffer_test.v, to make sure the program exits in a reasonable time (~10s). Let the test be retried 2 times in a row if it fails.

This commit is contained in:
Delyan Angelov 2025-07-22 12:48:29 +03:00
parent 9f0094b0b4
commit 810a90efa6
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -1,7 +1,17 @@
// vtest build: !gcc-windows && !msvc-windows && !tcc-windows // vtest retry: 2
import datatypes.lockfree
import time import time
import sync import sync
import datatypes.lockfree
fn testsuite_begin() {
spawn fn () {
println('watchdog thread started...')
// Ensure that the whole program will finish,
// even in the case of a deadlock (which seems to happen on windows)
time.sleep(10_000 * time.millisecond)
exit(2)
}()
}
// Test basic push and pop operations // Test basic push and pop operations
fn test_push_and_pop() { fn test_push_and_pop() {