From 1dd2d6a60185293910c528019922614847a84824 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Thu, 13 Nov 2014 17:03:36 +0100 Subject: [PATCH] Fixed bug #43600: --pipe --linebuffer --round does not work. --- src/parallel | 2 ++ testsuite/tests-to-run/parallel-local23.sh | 3 +++ testsuite/wanted-results/parallel-local23 | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/src/parallel b/src/parallel index cc8feb7b..06a7d6dd 100755 --- a/src/parallel +++ b/src/parallel @@ -483,6 +483,7 @@ sub round_robin_write { my ($header_ref,$block_ref,$recstart,$recend,$endpos) = @_; my $something_written = 0; my $block_passed = 0; + my $sleep = 1; while(not $block_passed) { # Continue flushing existing buffers # until one is empty and a new block is passed @@ -497,6 +498,7 @@ sub round_robin_write { last; } } + $sleep = ::reap_usleep($sleep); } start_more_jobs(); return $something_written; diff --git a/testsuite/tests-to-run/parallel-local23.sh b/testsuite/tests-to-run/parallel-local23.sh index 5adc5e29..38fd054b 100755 --- a/testsuite/tests-to-run/parallel-local23.sh +++ b/testsuite/tests-to-run/parallel-local23.sh @@ -31,6 +31,9 @@ echo echo '### test round-robin'; nice seq 1000 | $NICEPAR --block 1k --pipe --round-robin wc | sort +echo '### bug #43600: --pipe --linebuffer --round does not work' + seq 10000000000 | parallel --pipe --linebuffer --round cat | head + echo '### --version must have higher priority than retired options' $NICEPAR --version -g -Y -U -W -T | tail diff --git a/testsuite/wanted-results/parallel-local23 b/testsuite/wanted-results/parallel-local23 index 959cbb70..830a7893 100644 --- a/testsuite/wanted-results/parallel-local23 +++ b/testsuite/wanted-results/parallel-local23 @@ -50,6 +50,19 @@ echo '### test round-robin'; nice seq 1000 | $NICEPAR --block 1k --pipe --roun 250 250 1000 250 250 1000 277 277 1000 +echo '### bug #43600: --pipe --linebuffer --round does not work' +### bug #43600: --pipe --linebuffer --round does not work + seq 10000000000 | parallel --pipe --linebuffer --round cat | head +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 echo '### --version must have higher priority than retired options' ### --version must have higher priority than retired options $NICEPAR --version -g -Y -U -W -T | tail