mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Use pytest-rerunfailures instead of re-inventing it.
This commit is contained in:
parent
9d268b99ad
commit
af355244a1
3
.github/workflows/ctest.yml
vendored
3
.github/workflows/ctest.yml
vendored
|
@ -18,7 +18,8 @@ jobs:
|
|||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install octave octave-common octave-signal sox python3 python3-pip portaudio19-dev python3-pyaudio
|
||||
pip3 install psutil crcengine ujson pyserial numpy structlog miniaudio sounddevice pytest
|
||||
pip3 install psutil crcengine ujson pyserial numpy structlog miniaudio sounddevice
|
||||
pip3 install pytest pytest-rerunfailures
|
||||
|
||||
- name: Build codec2
|
||||
shell: bash
|
||||
|
|
|
@ -7,7 +7,6 @@ import sys
|
|||
import time
|
||||
|
||||
import pytest
|
||||
import structlog
|
||||
|
||||
# pylint: disable=wrong-import-position
|
||||
sys.path.insert(0, "..")
|
||||
|
@ -17,33 +16,26 @@ import util_tnc_IRS as irs
|
|||
import util_tnc_ISS as iss
|
||||
|
||||
|
||||
# These do not update static.INFO.
|
||||
# "CONNECT", "SEND_TEST_FRAME"
|
||||
# These do not update static.INFO:
|
||||
# "CONNECT", "SEND_TEST_FRAME"
|
||||
# This test is currently a little inconsistent.
|
||||
@pytest.mark.flaky(reruns=3)
|
||||
@pytest.mark.parametrize("command", ["CQ", "PING", "BEACON"])
|
||||
def test_tnc(command):
|
||||
|
||||
# This test is currently a little inconsistent.
|
||||
iss_proc: multiprocessing.Process = None
|
||||
irs_proc: multiprocessing.Process = None
|
||||
for _ in range(3):
|
||||
iss_proc = multiprocessing.Process(target=iss.t_arq_iss, args=[command])
|
||||
irs_proc = multiprocessing.Process(target=irs.t_arq_irs, args=[command])
|
||||
# print("Starting threads.")
|
||||
iss_proc.start()
|
||||
irs_proc.start()
|
||||
iss_proc = multiprocessing.Process(target=iss.t_arq_iss, args=[command])
|
||||
irs_proc = multiprocessing.Process(target=irs.t_arq_irs, args=[command])
|
||||
# print("Starting threads.")
|
||||
iss_proc.start()
|
||||
irs_proc.start()
|
||||
|
||||
time.sleep(12)
|
||||
time.sleep(12)
|
||||
|
||||
# print("Terminating threads.")
|
||||
irs_proc.terminate()
|
||||
iss_proc.terminate()
|
||||
irs_proc.join()
|
||||
iss_proc.join()
|
||||
|
||||
if iss_proc.exitcode == 0 and irs_proc.exitcode == 0:
|
||||
break
|
||||
|
||||
structlog.get_logger(__name__).error("Retrying.")
|
||||
# print("Terminating threads.")
|
||||
irs_proc.terminate()
|
||||
iss_proc.terminate()
|
||||
irs_proc.join()
|
||||
iss_proc.join()
|
||||
|
||||
for idx in range(2):
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue