]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Make a racy test failure less likely to happen.
authorJim Meyering <meyering@redhat.com>
Mon, 7 Jan 2008 13:21:34 +0000 (14:21 +0100)
committerJim Meyering <meyering@redhat.com>
Mon, 7 Jan 2008 13:21:34 +0000 (14:21 +0100)
* tests/misc/tty-eof: Uncomment a debug "warn".
This change happens to make this test far less likely to fail.
With that statement commented out, this test would fail about
20% of the time on my desktop.  Now, it's gone 100 iterations
in a row with no failure.

ChangeLog
tests/misc/tty-eof

index 676f33e960850ccea2817f78de0a6180169228bd..c03c0d1593b99094587d6dc0c0a4153508499dad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-01-07  Jim Meyering  <meyering@redhat.com>
 
+       Make a racy test failure less likely to happen.
+       * tests/misc/tty-eof: Uncomment a debug "warn".
+       This change happens to make this test far less likely to fail.
+       With that statement commented out, this test would fail about
+       20% of the time on my desktop.  Now, it's gone 100 iterations
+       in a row with no failure.
+
        * NEWS: Mention the cp bug fix.
 
 2008-01-07  Jan Blunck  <jblunck@suse.de>
index 8cd2921fc47b129f23b690073780de690a91abb9..086f19cd67383306a57592f4691d31e5a1d3d71b 100755 (executable)
@@ -2,7 +2,7 @@
 # -*- perl -*-
 # Test whether programs exit upon a single EOF from a tty.
 
-# Copyright (C) 2003, 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -92,7 +92,7 @@ $@ and (warn "$ME: this script requires Perl's Expect package >=1.11\n"),
       $exp->send("\cD");  # This is Control-D.  FIXME: what if that's not EOF?
       $exp->expect (0, '-re', "^a b\\r?\$");
       my $found = $exp->expect (1, '-re', "^.+\$");
-      $found and warn "F: $found: " . $exp->exp_match () . "\n";
+      $found and warn "F: $found: " . $exp->exp_match () . "\n";
       $exp->expect(1, 'eof');
       # Expect no output from cut, since we gave it no input.
       defined $found || $cmd =~ /^cut/