Skip to contentSkip to conversation

tcl: clock.test needs a timezone to be set

PATCH New Ross Burton 1 participant 2 messages Jul 12, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 8/9 tcl: clock.test needs a timezone to be set

---
 meta/recipes-devtools/tcltk/tcl/run-ptest | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-devtools/tcltk/tcl/run-ptest +5 -1
index 6d52f34a9f..a62b703082 100644
@@ -1,7 +1,11 @@
 #!/bin/sh
 
+# clock.test needs a timezone to be set
+export TZ="Europe/London"
+export TCL_LIBRARY=library
+
 for i in `ls tests/*.test | awk -F/ '{print $2}'`; do
-    TCL_LIBRARY=library ./tcltest tests/all.tcl -file $i >$i.log 2>&1
+    ./tcltest tests/all.tcl -file $i >$i.log 2>&1
     grep -q -F -e "Files with failing tests:" -e "Test files exiting with errors:" $i.log
     if [ $? -eq 0 ]; then
         echo "FAIL: $i"
Signature · 1 line
2.25.1
#1 lore raw

PATCH v2 9/9 tcl: fix race in interp.test

There's a timeout race in interp which is exposed when running under load.

---
 meta/recipes-devtools/tcltk/tcl/interp.patch | 32 ++++++++++++++++++++
 meta/recipes-devtools/tcltk/tcl_8.6.11.bb    |  1 +
 2 files changed, 33 insertions(+)
 create mode 100644 meta/recipes-devtools/tcltk/tcl/interp.patch
meta/recipes-devtools/tcltk/tcl/interp.patch new file +32 -0
new file mode 100644
index 0000000000..95d6318f64
@@ -0,0 +1,32 @@
+The interp-36.7 patch has race conditions and is missing cleanup.  This patch by
+a Tcl maintainer should improve matters.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <[email protected]>
+
+diff --git a/tests/interp.test b/tests/interp.test
+index d7424847f..fc90990f3 100644
+--- a/tests/interp.test
++++ b/tests/interp.test
+@@ -3595,17 +3595,18 @@ test interp-36.7 {ChildBgerror sets error handler of child [1999035]} -setup {
+         variable result
+         set result [lindex $args 0]
+     }
++    set tout [after 5000 {set result timeout}]
+ } -body {
+     child eval {
+         variable done {}
+         after 0 error foo
+-        after 10 [list ::set [namespace which -variable done] {}]
+-        vwait [namespace which -variable done]
+     }
++    vwait result
+     set result
+ } -cleanup {
++    after cancel $tout
+     variable result {}
+-    unset -nocomplain result
++    unset -nocomplain result tout
+     interp delete child
+ } -result foo
+ 
meta/recipes-devtools/tcltk/tcl_8.6.11.bb +1 -0
index 0d7c2e4ac3..57a86e4c64 100644
@@ -22,6 +22,7 @@ SRC_URI = "${BASE_SRC_URI} \
            file://fix_issue_with_old_distro_glibc.patch \
            file://tcl-remove-hardcoded-install-path.patch \
            file://alter-includedir.patch \
+           file://interp.patch \
            file://run-ptest \
 "
 SRC_URI[sha256sum] = "cfb49aab82bd179651e23eeeb69606f51b0ddc575ca55c3d35e2457469024cfa"
Signature · 1 line
2.25.1