Try to avoid race condition in plugin test
This commit is contained in:
parent
268119a920
commit
b7862dda47
1 changed files with 9 additions and 2 deletions
|
|
@ -127,8 +127,15 @@ RUN mycroft-core/bin/mycroft-start bus && \
|
|||
tail -f /var/log/mycroft/audio.log | grep -iq 'audio service is ready' && \
|
||||
xargs -a tests/apope_sample.txt mycroft-core/bin/mycroft-speak && \
|
||||
mkdir -p "${MIMIC_DIR}" && \
|
||||
timeout 300 inotifywait -e create "${MIMIC_DIR}" && \
|
||||
find "${MIMIC_DIR}" -name '*.wav' | head -n1 | xargs -I{} mv {} tests/actual_sample.wav
|
||||
for i in $(seq 1 300); do \
|
||||
wav_path="$(find "${MIMIC_DIR}" -name '*.wav' | head -n1)"; \
|
||||
if [ -n "${wav_path}" ]; then \
|
||||
mv "${wav_path}" tests/actual_sample.wav; \
|
||||
break; \
|
||||
fi; \
|
||||
sleep 1; \
|
||||
echo "Looking for WAV file in ${MIMIC_DIR}"; \
|
||||
done
|
||||
|
||||
# Check sample
|
||||
RUN export expected_sample="tests/apope_sample_${TARGETARCH}${TARGETVARIANT}.wav" && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue