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
2 changed files with 17 additions and 24 deletions
3
.github/workflows/ctest.yml
vendored
3
.github/workflows/ctest.yml
vendored
|
@ -18,7 +18,8 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install octave octave-common octave-signal sox python3 python3-pip portaudio19-dev python3-pyaudio
|
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
|
- name: Build codec2
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
|
@ -7,7 +7,6 @@ import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import structlog
|
|
||||||
|
|
||||||
# pylint: disable=wrong-import-position
|
# pylint: disable=wrong-import-position
|
||||||
sys.path.insert(0, "..")
|
sys.path.insert(0, "..")
|
||||||
|
@ -17,15 +16,13 @@ import util_tnc_IRS as irs
|
||||||
import util_tnc_ISS as iss
|
import util_tnc_ISS as iss
|
||||||
|
|
||||||
|
|
||||||
# These do not update static.INFO.
|
# These do not update static.INFO:
|
||||||
# "CONNECT", "SEND_TEST_FRAME"
|
# "CONNECT", "SEND_TEST_FRAME"
|
||||||
|
# This test is currently a little inconsistent.
|
||||||
|
@pytest.mark.flaky(reruns=3)
|
||||||
@pytest.mark.parametrize("command", ["CQ", "PING", "BEACON"])
|
@pytest.mark.parametrize("command", ["CQ", "PING", "BEACON"])
|
||||||
def test_tnc(command):
|
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])
|
iss_proc = multiprocessing.Process(target=iss.t_arq_iss, args=[command])
|
||||||
irs_proc = multiprocessing.Process(target=irs.t_arq_irs, args=[command])
|
irs_proc = multiprocessing.Process(target=irs.t_arq_irs, args=[command])
|
||||||
# print("Starting threads.")
|
# print("Starting threads.")
|
||||||
|
@ -40,11 +37,6 @@ def test_tnc(command):
|
||||||
irs_proc.join()
|
irs_proc.join()
|
||||||
iss_proc.join()
|
iss_proc.join()
|
||||||
|
|
||||||
if iss_proc.exitcode == 0 and irs_proc.exitcode == 0:
|
|
||||||
break
|
|
||||||
|
|
||||||
structlog.get_logger(__name__).error("Retrying.")
|
|
||||||
|
|
||||||
for idx in range(2):
|
for idx in range(2):
|
||||||
try:
|
try:
|
||||||
os.unlink(f"/tmp/hfchannel{idx+1}")
|
os.unlink(f"/tmp/hfchannel{idx+1}")
|
||||||
|
|
Loading…
Reference in a new issue