diff options
author | pooryorick <com.digitalsmarties@pooryorick.com> | 2018-06-13 10:49:25 (GMT) |
---|---|---|
committer | pooryorick <com.digitalsmarties@pooryorick.com> | 2018-06-13 10:49:25 (GMT) |
commit | 33b84014364cffbf3c994dc7298164257512d2c4 (patch) | |
tree | fe3c34f93167ee96e711086a5c68ceb70b79c51e /tests/async.test | |
parent | b5e61d9f54b0a0579e07552cbca1e7b7a13444f8 (diff) | |
download | tcl-33b84014364cffbf3c994dc7298164257512d2c4.zip tcl-33b84014364cffbf3c994dc7298164257512d2c4.tar.gz tcl-33b84014364cffbf3c994dc7298164257512d2c4.tar.bz2 |
Avoid valgrind "still reachable" reports stemming from early termination of
threads.
Diffstat (limited to 'tests/async.test')
-rw-r--r-- | tests/async.test | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/tests/async.test b/tests/async.test index fa3aae1..34c2fdc 100644 --- a/tests/async.test +++ b/tests/async.test @@ -156,19 +156,24 @@ test async-4.1 {async interrupting bytecode sequence} -constraints { } } -body { apply {{handle} { - global aresult - set aresult {Async event not delivered} - testasync marklater $handle - # allow plenty of time to pass in case valgrind is running - set start [clock seconds] - while { - [clock seconds] - $start < 180 && $aresult eq "Async event not delivered" - } { - nothing - } + global aresult + set aresult {Async event not delivered} + testasync marklater $handle + # allow plenty of time to pass in case valgrind is running + set start [clock seconds] + while { + [clock seconds] - $start < 180 && $aresult eq "Async event not delivered" + } { + # be less busy + after 100 + nothing + } return $aresult }} $hm } -result {test pattern} -cleanup { + # give other threads some time to go way so that valgrind doesn't pick up + # "still reachable" cases from early thread termination + after 100 testasync delete $hm } test async-4.2 {async interrupting straight bytecode sequence} -constraints { @@ -185,10 +190,15 @@ test async-4.2 {async interrupting straight bytecode sequence} -constraints { while { [clock seconds] - $start < 180 && $aresult eq "Async event not delivered" } { + # be less busy + after 100 } return $aresult }} $hm } -result {test pattern} -cleanup { + # give other threads some time to go way so that valgrind doesn't pick up + # "still reachable" cases from early thread termination + after 100 testasync delete $hm } test async-4.3 {async interrupting loop-less bytecode sequence} -constraints { @@ -205,6 +215,9 @@ test async-4.3 {async interrupting loop-less bytecode sequence} -constraints { return $aresult }]] $hm } -result {test pattern} -cleanup { + # give other threads some time to go way so that valgrind doesn't pick up + # "still reachable" cases from early thread termination + after 100 testasync delete $hm } |