From 38b20a9e56e397023de6e95630bfb9e38c029099 Mon Sep 17 00:00:00 2001 From: Mooneer Salem Date: Thu, 5 Jun 2025 12:58:05 -0700 Subject: [PATCH] Increase sleep time before killing recording to resolve macOS test failures. (#917) * Increase sleep time before killing recording to resolve macOS test failures. * Add PR #917 to changelog. --- USER_MANUAL.md | 1 + test/hamlibserver.py | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/USER_MANUAL.md b/USER_MANUAL.md index fed0e4c4..ab0a7cb3 100644 --- a/USER_MANUAL.md +++ b/USER_MANUAL.md @@ -797,6 +797,7 @@ LDPC | Low Density Parity Check Codes - a family of powerful FEC codes * Reduce usage of non-real time safe code. (PR #900) * FreeDV Reporter: Force explicit background color (avoids unwanted mouseover highlights on Linux). (PR #911) * Fix compiler errors when using wxWidgets 3.0. (PR #914) + * Unit tests: Increase sleep time before killing recording to resolve macOS test failures. (PR #917) ## V2.0.0 June 2025 diff --git a/test/hamlibserver.py b/test/hamlibserver.py index 3a56d822..94b8d3b0 100755 --- a/test/hamlibserver.py +++ b/test/hamlibserver.py @@ -322,9 +322,11 @@ class HamlibHandler: self.ErrParam() else: if (not x) and self.app.ptt: - # Sleep for 20ms to match typical SDR behavior + 5ms to account for varying system load. - # Example: Flex 6000/8000 (https://community.flexradio.com/discussion/8028104/question-regarding-tx-delay) - time.sleep(25 / 1000) + # Sleep for 20ms to match typical SDR behavior + 30ms to account for varying system load/virtual audio latency. + # References: + # Virtual audio latency: https://vb-audio.com/Cable/VBCABLE_ReferenceManual.pdf (assuming 10ms/512 sample buffer size @ 48 kHz) + # Example TX->RX switching time: Flex 6000/8000 (https://community.flexradio.com/discussion/8028104/question-regarding-tx-delay) + time.sleep(50 / 1000) os.kill(self.pid, signal.SIGTERM) if x: self.app.ptt = 1