Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Test script "io.test" io-13.6 may not pass on slow machine

Closed / Fixed218645ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:03:38
OriginalBugID: 1580 Bug
Version: 8.1b2
SubmitDate: '1999-03-22'
LastModified: '1999-03-25'
Severity: MED
Status: Released
Submitter: pat
ChangedBy: admin
RelatedBugIDs: 1521
OS: SunOS
OSVersion: 5.7 (SPARC)
Machine: Sparc
FixedDate: '1999-03-25'
FixedInVersion: 8.1b3
ClosedDate: '2000-10-25'


Name:
Taketo Kabe

ReproducibleScript:
    on UNIX source distribution,
       $ make test
    or
       $ env LD_LIBRARY_PATH=../unix ../unix/tcltest
       % cd ../tests
       % source io.test
    



ObservedBehavior:
    % cd ../tests
    % source io.test
    (will skip non-portable tests)
    
    ==== io-13.6 TranslateInputEOL: auto mode: saw cr in last segment
    FAILED
    ==== Contents of test case:
    
        # (chanPtr->flags & INPUT_SAW_CR)
    
        set f [open "|[list $tcltest cat]" w+]
        fconfigure $f -blocking 0 -buffering none -translation {auto lf}
    
        fileevent $f read "ready $f"
        proc ready {f} {
            lappend ::x [read $f] [testchannel queuedcr $f]
        }
        set x {}
    
        puts -nonewline $f "abcdefghj\r"
        after 100 {set y ok}
        vwait y
    
        puts -nonewline $f "\n01234"
        after 100 {set y ok}
        vwait y
    
        close $f
        set x
    
    ---- Result was:
    {abcdefghj
    01234} 0
    ---- Result should have been:
    {abcdefghj
    } 1 01234 0
    ==== io-13.6 FAILED
    
    



DesiredBehavior:
    >> ---- Result should have been:
    >> {abcdefghj
    >> } 1 01234 0
    



Patch:
--- tests/io.test.distSun Mar 14 03:08:21 1999
+++ tests/io.testSun Mar 21 23:44:00 1999
@@ -1490,12 +1490,12 @@
     set x {}
 
     puts -nonewline $f "abcdefghj\r"
-    after 100 {set y ok}
-    vwait y
+    #
+    vwait x
 
     puts -nonewline $f "\n01234"
-    after 100 {set y ok}
-    vwait y
+    #
+    vwait x
 
     close $f
     set x




PatchFiles:
    tests/io.test
    





    100 milliseconds may not be enough for slow machines to take care
    of the fileevent callback.
    This causes timing skew on the result list in the test.
    Using the "correct" vwait argument should be better rather then ad-hoc
    timing.

    Well, the machine (SparcStation 20) may not be classified as "slow", but
    it fails anyway...

This patch made the test hang on the solaris machine "weasel", but I fixed the test failure on slow machines by changing the "after 100" calls to "after 500".  The user who reported the bug confirmed that the change solved the problem on his machine.  03/24/1999 20:28 - admin -
welch Closed ticket [218645ffff]. [History diff]2000-10-26 08:26:10
dgp Ticket [218645ffff]: 4 changes [History diff]2001-04-05 08:22:16
Log in (anonymous is fine) to add a comment.