From 810a90efa63652eb4cf17d1155761c86ba0a8760 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 22 Jul 2025 12:48:29 +0300 Subject: [PATCH] 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. --- vlib/datatypes/lockfree/ringbuffer_test.v | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/vlib/datatypes/lockfree/ringbuffer_test.v b/vlib/datatypes/lockfree/ringbuffer_test.v index 809e2b9544..19b5b19c98 100644 --- a/vlib/datatypes/lockfree/ringbuffer_test.v +++ b/vlib/datatypes/lockfree/ringbuffer_test.v @@ -1,7 +1,17 @@ -// vtest build: !gcc-windows && !msvc-windows && !tcc-windows -import datatypes.lockfree +// vtest retry: 2 import time 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 fn test_push_and_pop() {