GNU bug report logs - #8074
Fix sparse-pipe test on 2.6.26 kernel

Previous Next

Package: coreutils;

Reported by: "Gilles Espinasse" <g.esp <at> free.fr>

Date: Fri, 18 Feb 2011 08:57:01 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


Message #16 received at 8074-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: "Gilles Espinasse" <g.esp <at> free.fr>
Cc: Pádraig Brady <P <at> draigBrady.com>,
	8074-done <at> debbugs.gnu.org
Subject: Re: bug#8074: Fix sparse-pipe test on 2.6.26 kernel
Date: Fri, 18 Feb 2011 13:54:22 +0100
Gilles Espinasse wrote:

> ----- Original Message -----
> From: "Pádraig Brady" <P <at> draigBrady.com>
> To: "Gilles Espinasse" <g.esp <at> free.fr>
> Cc: "Jim Meyering" <jim <at> meyering.net>; <8074 <at> debbugs.gnu.org>
> Sent: Friday, February 18, 2011 11:54 AM
> Subject: bug#8074: Fix sparse-pipe test on 2.6.26 kernel
>
>
> ...
>> >
>> > If I add a dd if=/dev/null of=pipe conv=notrunc,fdatasync, test
> reliabily
>> > work too.
>> > So I added that in attached patch.
>>
>> Good testing!
>> Interesting to see that fdatasync flushes the pipe to disk.
>> However it might be more portable/robust to use `wait`
>> rather than that dd command?
>>
>> cheers,
>> Pádraig.
>>
> wait work fine
> Find v2 attached

Thanks to both of you.
That was just a buggy (racy) test, independent of kernel
or distro, so I've adjusted comments accordingly:

From e6067bcb040f110238bd7cbf9f3781f2e149e0c0 Mon Sep 17 00:00:00 2001
From: Gilles Espinasse <g.esp <at> free.fr>
Date: Fri, 18 Feb 2011 13:52:21 +0100
Subject: [PATCH] tests: correct racy sparse-to-pipe test

* tests/cp/sparse-to-pipe: Wait for backgrounded "cat" to complete
before comparing the results.
---
 tests/cp/sparse-to-pipe |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/cp/sparse-to-pipe b/tests/cp/sparse-to-pipe
index 4d39458..9bbaafa 100755
--- a/tests/cp/sparse-to-pipe
+++ b/tests/cp/sparse-to-pipe
@@ -25,7 +25,11 @@ mkfifo_or_skip_ pipe
 timeout 10 cat pipe > copy &

 truncate -s1M sparse || framework_failure_
 cp sparse pipe || fail=1
+
+# Ensure that the cat has completed before comparing.
+wait
+
 cmp sparse copy || fail=1

 Exit $fail
--
1.7.4.1.16.g759e8




This bug report was last modified 14 years and 153 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.