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