fix: Fix test execution hanging issue
- Replace `os.execute()` with `os.system()` - Avoid hanging due to unclosed file descriptors - Update error message to include command exit code
This commit is contained in:
@@ -121,11 +121,11 @@ fn dotest(path string, base_dir string, mut cache TestCache) ! {
|
|||||||
|
|
||||||
cmd := 'v -stats -enable-globals -n -w -gc none test ${norm_path}'
|
cmd := 'v -stats -enable-globals -n -w -gc none test ${norm_path}'
|
||||||
println(cmd)
|
println(cmd)
|
||||||
result := os.execute(cmd)
|
|
||||||
eprintln(result)
|
// Use system() instead of execute() to avoid hanging on unclosed file descriptors
|
||||||
if result.exit_code != 0 {
|
exit_code := os.system(cmd)
|
||||||
eprintln('Test failed: ${path}')
|
if exit_code != 0 {
|
||||||
eprintln(result.output)
|
eprintln('Test failed: ${path} (exit code: ${exit_code})')
|
||||||
exit(1)
|
exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user