sort test output for xargs -n2 -P0
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 159 Build 159: arc lint + arc unit
Event Timeline
This won't fix it unfortunately. The test does a direct comparison of output. It needs to use a slightly more intelligent algorithm for determining pass/fail criteria.
If the output was changed to this:
- quick brown
- fox jumped
- over the
- lazy dog
Running cat file | xargs -P0 | sort -n should give the desired output 100% of the time.
The assumption I made was that these were on separate lines. This is definitely not the case. My suggestion might be on the right track (numbering), but the solution itself is flawed.
Please let me know if my proposed change to use sort instead of sort -u seems reasonable.
Before:
- Deterministically failed on my VMware Fusion instance.
After:
- Survived 200 consecutive runs with kyua test (I changed the sort command to use sort instead of sort -u to avoid disguising potential bugs with xargs):
$ cd /usr/tests/usr.bin/xargs
$ for i in $(seq 1 200); do kyua test||break; done
$ svn diff .
Index: regress.n2P0.out
- regress.n2P0.out (revision 287002)
+++ regress.n2P0.out (working copy)
@@ -1,4 +1,4 @@
-quick brown
fox jumped
+lazy dog
over the
-lazy dog
+quick brown
Index: regress.sh
- regress.sh (revision 287004)
+++ regress.sh (working copy)
@@ -12,7 +12,7 @@
REGRESSION_TEST(R', xargs -I% -R1 echo The % % % %% % % <${SRCDIR}/regress.in')
REGRESSION_TEST(n1', xargs -n1 echo <${SRCDIR}/regress.in')
REGRESSION_TEST(n2', xargs -n2 echo <${SRCDIR}/regress.in')
-#REGRESSION_TEST(n2P0',xargs -n2 -P0 echo <${SRCDIR}/regress.in')
+REGRESSION_TEST(n2P0',xargs -n2 -P0 echo <${SRCDIR}/regress.in | sort')
REGRESSION_TEST(n3', xargs -n3 echo <${SRCDIR}/regress.in')
REGRESSION_TEST(0', xargs -0 -n1 echo <${SRCDIR}/regress.0.in')
REGRESSION_TEST(0I', xargs -0 -I% echo The % %% % <${SRCDIR}/regress.0.in')