Skip to content
Snippets Groups Projects
Commit fa76f04c authored by Niko Tyni's avatar Niko Tyni
Browse files

Patch t/read-write.t to work around a race condition

Closes: #848408
parent 00854e75
No related branches found
No related tags found
No related merge requests found
From 4be700470b199608dc67fdde506e14543270a8eb Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Wed, 28 Dec 2016 11:53:15 +0200
Subject: [PATCH] Work around a race condition in t/read-write.t
If the script exits before IO::Pty::Easy has read its output, the final
newline gets lost. This seems to mostly happen on single-CPU hosts.
Just sleeping long enough (at least 2.5 or so seconds) would make
IO::Pty::Easy kill the child when $pty goes out of scope, but waiting
one second before exiting should be enough.
Bug-Debian: https://bugs.debian.org/848408
Bug: https://github.com/doy/app-termcast/issues/3
---
t/read-write.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/read-write.t b/t/read-write.t
index fe945dc..7b70271 100644
--- a/t/read-write.t
+++ b/t/read-write.t
@@ -35,7 +35,7 @@ test_tcp(
user => 'test',
password => 'tset',
);
- \$tc->run(\$^X, '-ple', q[last if /^\$/]);
+ \$tc->run(\$^X, '-ple', q[sleep 1,last if /^\$/]);
EOF
my $pty = IO::Pty::Easy->new;
$pty->spawn($^X, (map {; '-I', $_ } @INC), '-e', $client_script);
--
2.11.0
0001-Work-around-a-race-condition-in-t-read-write.t.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment