Tk Library Source Code

View Ticket
Login
Ticket UUID: 3062782
Title: graphops.test fail
Type: Bug Version: None
Submitter: dgp Created on: 2010-09-09 16:33:52
Subsystem: struct :: graph Assigned To: andreas_kupries
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2010-09-30 02:33:10
Resolution: Invalid Closed By: sf-robot
    Closed on: 2010-09-29 19:33:10
Description:
==== modules/struct/graphops.test graphop-ttcl-gtcl-stcl-sttcl-qtcl-bipartite-3.2 FAILED =========
==== Contents of test case:

    SETUP_D
    set result [struct::graph::op::isBipartite? mygraph]
    mygraph destroy
    set result

---- Result was:
---- Return code should have been one of: 0 2
---- errorInfo: can't read "qret": no such variable
    while executing
"llength $qret"
    (class "::struct::queue::queue_oo" method "size" line 3)
    invoked from within
"$pending size"
    (procedure "struct::graph::op::isBipartite?" line 49)
    invoked from within
"struct::graph::op::isBipartite? mygraph"
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $script"
---- Result should have been:

==== modules/struct/graphops.test graphop-ttcl-gtcl-stcl-sttcl-qtcl-bipartite-3.2 ====


Then most (all?) the rest of the tests in graphops.test
also fail because the tests are not independent.  The
failure of one test to properly cleanup causes later
tests to fail.

Actual bug appears to be in queue_oo.tcl ?
User Comments: sf-robot added on 2010-09-30 02:33:10:
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 14 days (the time period specified by
the administrator of this Tracker).

andreas_kupries added on 2010-09-10 22:26:52:
Right. I will see to it that the TclOO based code requests 0.6.1 at least.

dgp added on 2010-09-10 21:20:38:
Removing the old TclOO installs
corrects the problem.

dgp added on 2010-09-10 21:17:43:
Would it explain the symptoms if
"TclOO 0.3" was getting used?

Can probably classify this as PEBKAC,
since such old "alphas" should be uninstalled.

Possibly there's an improvement here for
tcllib code using TclOO to demand something
more recent, but I'll leave that to the maintainers.

andreas_kupries added on 2010-09-10 05:14:26:
Another datapoint, my 8.6b1.2/0.6.2 is CVS head as of Sep 1, 2010.

andreas_kupries added on 2010-09-10 05:11:51:
Well, first tests are not able to replicate the problem.
    Linux + Tcl 8.5.7 + TclOO 0.6.1
Ditto for a second system:
    Linux + Tcl 8.6b1.2 + TclOO 0.6.2

I am suspecting a TclOO bug now, for your particular revision. It would have to be in variable resolution.

qret is an instance variable declared in line 19 of queue_oo.tcl, initialized in line 27 (constructor), and is accessed in nearly all methods, including 'size'. In our context (op::isBipartite?) there is only one queue method run before 'size', namely 'put', which is one of the few methods not using that variable. The test in question is also the first test where the graph is not empty, thus actually arriving at the code using the queue and loop.

So, class def looks fine to my eyes. Should possibly ask DKF for his opinion on that too.

andreas_kupries added on 2010-09-10 04:51:59:
First step, made tests in 7 files properly independent, using tcltest v2 abilities.

./graph/tests/ops/componentof.test
./graph/tests/ops/tarjan.test
./graph/tests/ops/components.test
./graph/tests/ops/adjmatrix.test
./graph/tests/ops/prim.test
./graph/tests/ops/kruskal.test
./graph/tests/ops/bipartite.test

This covers all tests coming before bipartite, and a number coming after. Not all. Conversion of the remaining files will be an incremental effort.