Nim icon indicating copy to clipboard operation
Nim copied to clipboard

testament: timeout doesn't finish process early

Open metagn opened this issue 1 year ago • 0 comments

Testament has a timeout property in test specs, but it's only checked after the process is done. It doesn't terminate the test process early if it passes the timeout duration.

The process is created in callNimCompiler but I could not get it to work with waitForExit. Test code that just does sleep(100_000) is not treated as timed out on Windows either by waitForSingleObject or getExitCodeProcess, which gives an exit code of 0 after 1.2 seconds. It would be better than the current situation if it at least worked on other OSes but I don't know if it would.

I was hoping to add a default 5 minute timeout for every test, in #24252 I accidentally wrote an infinite loop in the compiler and it didn't show which test failed because it ran indefinitely and the entire CI was cancelled.

metagn avatar Oct 10 '24 17:10 metagn