diff options
author | dgp <dgp@users.sourceforge.net> | 2011-09-18 19:10:11 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2011-09-18 19:10:11 (GMT) |
commit | 18492c312190b67e04959f7245dd3821b3222702 (patch) | |
tree | 3b3676a336050b24f0a48c9275e2d216368c6f26 | |
parent | 4e6d7ac04b768be3cca7788d3d97483d809918a0 (diff) | |
download | tcl-18492c312190b67e04959f7245dd3821b3222702.zip tcl-18492c312190b67e04959f7245dd3821b3222702.tar.gz tcl-18492c312190b67e04959f7245dd3821b3222702.tar.bz2 |
Revise the tests that confront background flush on close across threads.
Need cleanup code to bring an end to the otherwise endless loop of thread
finalization that continually tries to flush before closing, and is
continually thwarted by a driver raising EAGAIN. If this dance isn't
cleanly terminated, it continues and corrupts any subsequent tests that
define a [foo] command.
-rw-r--r-- | tests/ioCmd.test | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/ioCmd.test b/tests/ioCmd.test index f749b46..c46dc26 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -2575,9 +2575,10 @@ test iocmd.tf-24.15 {chan write, EAGAIN means that writing is not allowed at thi } c] set res } -cleanup { + proc foo {args} {onfinal; set ::done-24.15 1; return 3} + vwait done-24.15 rename foo {} unset res - update } -result {{write rc* ABC} {watch rc* write} {}} \ -constraints {testchannel thread} @@ -2601,15 +2602,17 @@ test iocmd.tf-24.16 {chan write, note the background flush setup by close due to } c] # Replace handler with all-tracking one which doesn't error. # This will tell us if a write-due-flush is there. - proc foo {args} { note BG ; track } + proc foo {args} { onfinal; note BG ; track ; set ::endbody-24.16 1} # Flush (sic!) the event-queue to capture the write from a # BG-flush. - update + vwait endbody-24.16 set res } -cleanup { + proc foo {args} {onfinal; set ::done-24.16 1; return 3} + vwait done-24.16 rename foo {} unset res -} -result {{write rc* ABC} {watch rc* write} {} BG {write rc* ABC} BG {finalize rc*}} \ +} -result {{write rc* ABC} {watch rc* write} {} BG {write rc* ABC}} \ -constraints {testchannel thread} # --- === *** ########################### |