retitle 760841 pspp: random testsuite failures
thanks

Affects GNU/Linux too!  It's odd the issue has only been seen yet on
kfreebsd rather than linux buildds;  I reproduced it on linux-amd64, and
with similar ~2% probability:

> ~/pspp-0.8.3$ for i in $(seq 1 1000) ; do printf 'e\0n\0t\0r\0\351\0e\0\n\0' 
> | tests/libpspp/u8-istream-test read - Auto | xxd ; done | sort | uniq -c | 
> sort -bn
>      21 0000000: 6500 6e00 7400 7200 c3a9 0065 000a 00    e.n.t.r....e...
>     979 0000000: 656e 7472 c3a9 650a                      entr..e.

For sanity, I've checked that printf is working correctly:

> ~/pspp-0.8.3$ for i in $(seq 1 1000) ; do printf 'e\0n\0t\0r\0\351\0e\0\n\0' 
> | xxd ; done | sort | uniq -c | sort -bn
>    1000 0000000: 6500 6e00 7400 7200 e900 6500 0a00       e.n.t.r...e...

So it may be related to how the tests/libpspp/u8-istream-test program
does its reads from stdin?  I'm also curious why the read is truncated
only sometimes - possibly a glibc issue there?

A potential workaround in the pspp testsuite is to use a temporary file
for the test input, this always seems to work correctly.  (Please see
attached).  I'm hoping the test runs in its own, clean working directory
so that a parallel-running test can't overwrite the input file, I
haven't checked this.

Regards,
-- 
Steven Chamberlain
ste...@pyro.eu.org
--- pspp-0.8.3/tests/libpspp/u8-istream.at.orig	2014-02-11 05:11:03.000000000 +0000
+++ pspp-0.8.3/tests/libpspp/u8-istream.at	2014-09-08 14:28:45.935891139 +0100
@@ -140,16 +140,16 @@
 AT_SETUP([read UTF-16 as Auto])
 AT_KEYWORDS([u8_istream])
 AT_CHECK([i18n-test supports_encodings UTF-16 UTF-16BE UTF-16LE])
-AT_CHECK([printf '\0e\0n\0t\0r\0\351\0e\0\n' | u8-istream-test read - Auto],
+AT_CHECK([printf '\0e\0n\0t\0r\0\351\0e\0\n' > input && u8-istream-test read input Auto],
   [0], [entrée
 ])
-AT_CHECK([printf 'e\0n\0t\0r\0\351\0e\0\n\0' | u8-istream-test read - Auto],
+AT_CHECK([printf 'e\0n\0t\0r\0\351\0e\0\n\0' > input && u8-istream-test read input Auto],
   [0], [entrée
 ])
-AT_CHECK([printf '\376\377\0e\0n\0t\0r\0\351\0e\0\n' | u8-istream-test read - Auto],
+AT_CHECK([printf '\376\377\0e\0n\0t\0r\0\351\0e\0\n' > input && u8-istream-test read input Auto],
   [0], [entrée
 ])
-AT_CHECK([printf '\377\376e\0n\0t\0r\0\351\0e\0\n\0' | u8-istream-test read - Auto],
+AT_CHECK([printf '\377\376e\0n\0t\0r\0\351\0e\0\n\0' > input && u8-istream-test read input Auto],
   [0], [entrée
 ])
 AT_CLEANUP

Reply via email to