aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2020-04-04 17:47:38 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-07 11:36:21 -0400
commit394d1421fd043e13b3dcd097133bd4eced2ad563 (patch)
tree39b5283cb2a6f7a50837636710598ddc5734055b
parentde582149c5be94a1ff7d3d8ee3526501b26c7f03 (diff)
downloadkvm-unit-tests-394d1421fd043e13b3dcd097133bd4eced2ad563.tar.gz
run_migration: Implement our own wait
Bash 5.0 changed 'wait' with no arguments to also wait for all process substitutions. For example, with Bash 4.4 this completes, after waiting for the sleep ( sleep 1 & wait ) > >(tee /dev/null) but with Bash 5.0 it does not. The kvm-unit-tests (overly) complex bash scripts have a 'run_migration ... 2> >(tee /dev/stderr)' where the '2> >(tee /dev/stderr)' comes from 'run_qemu'. Since 'run_migration' calls 'wait' it will never complete with Bash 5.0. Resolve by implementing our own wait; just a loop on job count. Signed-off-by: Andrew Jones <drjones@redhat.com> Message-Id: <20200404154739.217584-2-drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--scripts/arch-run.bash6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index d3ca19d..da1a9d7 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -156,7 +156,11 @@ run_migration ()
echo > ${fifo}
wait $incoming_pid
ret=$?
- wait
+
+ while (( $(jobs -r | wc -l) > 0 )); do
+ sleep 0.5
+ done
+
return $ret
}