Skip to content

Commit

Permalink
tests: fix init_global_test.v failing occasionally (#20879)
Browse files Browse the repository at this point in the history
  • Loading branch information
smalltalkman committed Feb 21, 2024
1 parent b83ce21 commit 27e6fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/tests/init_global_test.v
Expand Up @@ -154,14 +154,14 @@ fn test_global_shared_map() {
fn switch2() u64 {
mut cnt := u64(0)
for {
cnt++
mtx.@lock()
f1, f2 = f2, f1
if f1 == 17.0 || f2 == 17.0 {
mtx.unlock()
return cnt
}
mtx.unlock()
cnt++
}
return 0
}
Expand All @@ -185,6 +185,6 @@ fn test_global_mutex() {
assert (f1 == 17.0 && f2 == 34.0625) || (f1 == 34.0625 && f2 == 17.0)
mtx.runlock()
n := t.wait()
eprintln('> n: ${n} | f1: ${f1} | ${f2}: ${f2}')
eprintln('> n: ${n} | f1: ${f1} | f2: ${f2}')
assert n > 0
}

0 comments on commit 27e6fef

Please sign in to comment.