Skip to content

Commit 6571963

Browse files
committed
ci: fix a retry bug in vlib/v/compiler_errors_test.v, that made it report errors, even after a second retry succeeded
1 parent ab04a58 commit 6571963

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

vlib/v/compiler_errors_test.v

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,21 @@ fn work_processor(work chan TaskDescription, results chan TaskDescription) {
322322
mut task := <-work or { break }
323323
mut i := 0
324324
for i = 1; i <= task.max_ntries; i++ {
325+
// reset the .is_error flag, from the potential previous retries, otherwise it can
326+
// be set on the first retry, all the next retries can succeed, and the task will
327+
// be still considered failed, with a very puzzling non difference reported.
328+
task.is_error = false
325329
sw := time.new_stopwatch()
326330
task.execute()
327331
task.took = sw.elapsed()
332+
cli_cmd := task.get_cli_cmd()
328333
if !task.is_error {
334+
if i > 1 {
335+
eprintln('> succeeded after ${i:3}/${task.max_ntries} retries, doing `${cli_cmd}`')
336+
}
329337
break
330338
}
331-
cli_cmd := task.get_cli_cmd()
332-
eprintln('> failed ${i:3} times, doing `${cli_cmd}`\n')
339+
eprintln('> failed ${i:3}/${task.max_ntries} times, doing `${cli_cmd}`')
333340
if i <= task.max_ntries {
334341
time.sleep(100 * time.millisecond)
335342
}

0 commit comments

Comments
 (0)