summaryrefslogtreecommitdiffstats
path: root/tests/ioCmd.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2011-09-19 15:26:24 (GMT)
committerdgp <dgp@users.sourceforge.net>2011-09-19 15:26:24 (GMT)
commit12b5a6914cc9a4c32cdcd7090cc77ddff8788e66 (patch)
treee91f2e8f8427917f28cc952585d0118d448a7010 /tests/ioCmd.test
parentbd3d162f011f2a5728eaffba2ad513bf15d6d3e6 (diff)
downloadtcl-12b5a6914cc9a4c32cdcd7090cc77ddff8788e66.zip
tcl-12b5a6914cc9a4c32cdcd7090cc77ddff8788e66.tar.gz
tcl-12b5a6914cc9a4c32cdcd7090cc77ddff8788e66.tar.bz2
Constrain test iocmd.tf-32.1 to be skipped during valgrinding. It contains a iocmd_leaks
memory leak that cannot be plugged while testing what the test aims to test.
Diffstat (limited to 'tests/ioCmd.test')
-rw-r--r--tests/ioCmd.test19
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test
index d45f7aa..4c08229 100644
--- a/tests/ioCmd.test
+++ b/tests/ioCmd.test
@@ -3510,7 +3510,6 @@ test iocmd.tf-31.8 {chan postevent, bad input} -match glob -body {
# B. Must not crash, must return proper errors.
test iocmd.tf-32.0 {origin thread of moved channel gone} -match glob -body {
-#LEAKS!
#puts <<$tcltest::mainThread>>main
set tida [thread::create -preserved];#puts <<$tida>>
@@ -3548,8 +3547,20 @@ test iocmd.tf-32.0 {origin thread of moved channel gone} -match glob -body {
} -constraints {testchannel thread} \
-result {1 {Owner lost} 1 {Owner lost} 1 {Owner lost} 1 {Owner lost} 1 {Owner lost}}
+
+# The test iocmd.tf-32.1 unavoidably exhibits a memory leak. We are testing
+# the ability of the reflected channel system to react to the situation where
+# the thread in which the driver routines runs exits during driver operations.
+# In this case, thread exit handlers signal back to the owner thread so that the
+# channel operation does not hang. There's no way to test this without actually
+# exiting a thread in mid-operation, and that action is unavoidably leaky (which
+# is why [thread::exit] is advised against).
+#
+# Use constraints to skip this test while valgrinding so this expected leak
+# doesn't prevent a finding of "leak-free".
+#
+testConstraint notValgrind [expr {![testConstraint valgrind]}]
test iocmd.tf-32.1 {origin thread of moved channel destroyed during access} -match glob -body {
-#LEAKS!
#puts <<$tcltest::mainThread>>main
set tida [thread::create -preserved];#puts <<$tida>>
@@ -3564,7 +3575,7 @@ test iocmd.tf-32.1 {origin thread of moved channel destroyed during access} -mat
oninit; onfinal; track;
# destroy thread during channel access
thread::exit
- return}
+ }
set chan [chan create {r w} foo]
fconfigure $chan -buffering none
set chan
@@ -3592,7 +3603,7 @@ test iocmd.tf-32.1 {origin thread of moved channel destroyed during access} -mat
catch {thread::release $tida}
thread::release $tidb
set res
-} -constraints {testchannel thread} \
+} -constraints {testchannel thread notValgrind} \
-result {Owner lost}
# ### ### ### ######### ######### #########