From 33b84014364cffbf3c994dc7298164257512d2c4 Mon Sep 17 00:00:00 2001 From: pooryorick Date: Wed, 13 Jun 2018 10:49:25 +0000 Subject: Avoid valgrind "still reachable" reports stemming from early termination of threads. --- tests/async.test | 33 +++++++++++++++++++++++---------- 1 file 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 } -- cgit v0.12 From 83d92bd747f9da3b8e3413897e5e36cc63eb938e Mon Sep 17 00:00:00 2001 From: dgp Date: Wed, 13 Jun 2018 15:59:15 +0000 Subject: Stop creating a stray child process. --- tests/main.test | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/main.test b/tests/main.test index 324b594..302f95e 100644 --- a/tests/main.test +++ b/tests/main.test @@ -1218,8 +1218,6 @@ namespace eval ::tcl::test::main { Bug 1775878 } -constraints { exec Tcltest - } -setup { - catch {set f [open "|[list [interpreter]]" w+]} } -body { exec [interpreter] << "testsetmainloop\nputs \\\npwd\ntestexitmainloop" >& result set f [open result] -- cgit v0.12