Skip to content

Commit 2c48cf1

Browse files
committed
event.test: event-15.1: make it more forgiving
50ms might be too much to expect on some VM environments Signed-off-by: Steve Bennett <steveb@workware.net.au>
1 parent 3a3fe3e commit 2c48cf1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

tests/event.test

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,10 @@ test event-15.1 {vwait with script} {jim} {
274274

275275
local proc waiter {} {&x &result} {
276276
lappend result $x
277-
after 50 waiter
277+
after 150 waiter
278278
}
279279

280-
after 50 waiter
280+
after 150 waiter
281281
vwait done_waiter [lambda {} {&x} {
282282
# By using a lambda to capture a reference to x, we can
283283
# avoid a global variable. (done_waiter is not used)
@@ -290,7 +290,9 @@ test event-15.1 {vwait with script} {jim} {
290290
# Note that especially on VMs the waiter may run less than 5 times,
291291
# so allow a range for the length of $result.
292292
set rn [llength $result]
293-
list $x [expr {$rn >= 3 && $rn <= 5}]
294-
} {5 1}
293+
if {$rn < 3 || $rn > 5} {
294+
error "Expected 3-5 iterations, got $rn"
295+
}
296+
} {}
295297

296298
testreport

0 commit comments

Comments
 (0)