From 359717970da030c1cf9efcb00d17e2c6814f95f5 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Tue, 4 Oct 2011 23:36:43 +0100 Subject: [PATCH] =?UTF-8?q?tests:=20don=E2=80=99t=20overwrite=20$timeout,?= =?UTF-8?q?=20kill=20timer=20when=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testcases/t/lib/i3test.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testcases/t/lib/i3test.pm b/testcases/t/lib/i3test.pm index 14ec8d32..9230c5ef 100644 --- a/testcases/t/lib/i3test.pm +++ b/testcases/t/lib/i3test.pm @@ -104,9 +104,10 @@ sub wait_for_event { }; # Trigger timeout after $timeout seconds (can be fractional) - my $timeout = AE::timer $timeout, 0, sub { warn "timeout"; $cv->send(0) }; + my $t = AE::timer $timeout, 0, sub { warn "timeout ($timeout secs)"; $cv->send(0) }; my $result = $cv->recv; + undef $t; return $result; }