From 18492c312190b67e04959f7245dd3821b3222702 Mon Sep 17 00:00:00 2001 From: dgp Date: Sun, 18 Sep 2011 19:10:11 +0000 Subject: 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. --- tests/ioCmd.test | 11 +++++++---- 1 file 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} # --- === *** ########################### -- cgit v0.12