Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 1 | From 426aa2ff62dda77fd011e8f630b9d4ea17984817 Mon Sep 17 00:00:00 2001 |
| 2 | From: Ross Burton <ross.burton@arm.com> |
| 3 | Date: Mon, 12 Jul 2021 14:50:13 +0100 |
| 4 | Subject: [PATCH] tcl: fix race in interp.test |
| 5 | |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 6 | The interp-36.7 patch has race conditions and is missing cleanup. This patch by |
| 7 | a Tcl maintainer should improve matters. |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 11 | --- |
| 12 | tests/interp.test | 7 ++++--- |
| 13 | 1 file changed, 4 insertions(+), 3 deletions(-) |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 14 | |
| 15 | diff --git a/tests/interp.test b/tests/interp.test |
Patrick Williams | 44b3caf | 2024-04-12 16:51:14 -0500 | [diff] [blame] | 16 | index d742484..fc90990 100644 |
Andrew Geissler | 5f35090 | 2021-07-23 13:09:54 -0400 | [diff] [blame] | 17 | --- a/tests/interp.test |
| 18 | +++ b/tests/interp.test |
| 19 | @@ -3595,17 +3595,18 @@ test interp-36.7 {ChildBgerror sets error handler of child [1999035]} -setup { |
| 20 | variable result |
| 21 | set result [lindex $args 0] |
| 22 | } |
| 23 | + set tout [after 5000 {set result timeout}] |
| 24 | } -body { |
| 25 | child eval { |
| 26 | variable done {} |
| 27 | after 0 error foo |
| 28 | - after 10 [list ::set [namespace which -variable done] {}] |
| 29 | - vwait [namespace which -variable done] |
| 30 | } |
| 31 | + vwait result |
| 32 | set result |
| 33 | } -cleanup { |
| 34 | + after cancel $tout |
| 35 | variable result {} |
| 36 | - unset -nocomplain result |
| 37 | + unset -nocomplain result tout |
| 38 | interp delete child |
| 39 | } -result foo |
| 40 | |