Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame^] | 1 | Upstream-Status: Backport |
| 2 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 3 | |
| 4 | From 4dfe7f9e702c85243a71e4de267a13e434b6d6c2 Mon Sep 17 00:00:00 2001 |
| 5 | From: Jean Delvare <jdelvare@suse.de> |
| 6 | Date: Fri, 20 Jan 2023 12:56:08 +0100 |
| 7 | Subject: [PATCH] test: Fix a race condition |
| 8 | |
| 9 | The test suite does not differentiate between stdout and stderr. When |
| 10 | messages are printed to both, the order in which they will reach us |
| 11 | is apparently not guaranteed. Ideally this would be deterministic, but |
| 12 | until then, explicitly test stdout and stderr separately in the test |
| 13 | case itself. Otherwise the test suite fails randomly, which is a pain |
| 14 | for distribution package maintainers. |
| 15 | |
| 16 | This fixes bug #63651 reported by Ross Burton: |
| 17 | https://savannah.nongnu.org/bugs/index.php?63651 |
| 18 | |
| 19 | Signed-off-by: Jean Delvare <jdelvare@suse.de> |
| 20 | --- |
| 21 | test/faildiff.test | 3 ++- |
| 22 | 1 file changed, 2 insertions(+), 1 deletion(-) |
| 23 | |
| 24 | diff --git a/test/faildiff.test b/test/faildiff.test |
| 25 | index 5afb8e3..0444c15 100644 |
| 26 | --- a/test/faildiff.test |
| 27 | +++ b/test/faildiff.test |
| 28 | @@ -27,8 +27,9 @@ What happens on binary files? |
| 29 | > File test.bin added to patch %{P}test.diff |
| 30 | |
| 31 | $ printf "\\003\\000\\001" > test.bin |
| 32 | - $ quilt diff -pab --no-index |
| 33 | + $ quilt diff -pab --no-index 2>/dev/null |
| 34 | >~ (Files|Binary files) a/test\.bin and b/test\.bin differ |
| 35 | + $ quilt diff -pab --no-index >/dev/null |
| 36 | > Diff failed on file 'test.bin', aborting |
| 37 | $ echo %{?} |
| 38 | > 1 |
| 39 | -- |
| 40 | 2.34.1 |
| 41 | |