From 45636d67c93e3722543e181900bcb74a52b01bbb Mon Sep 17 00:00:00 2001 From: Romain Naour Date: Mon, 31 Aug 2026 22:57:03 +0200 Subject: [PATCH] support/testing: TestMdnsd: improve test reliability The mdnsd runtime test can randomly fail on slow runners. It's hard to reproduce locally (only one failure after a few attempts) but we can reproduce it easily by removing the while loop entirely. It turns out that mdnsd is started by S50mdnsd before the emulator.login() change the system date: [BRTEST# date -s @1788032864 Sat Aug 29 19:47:44 UTC 2026 Since the minimal rootfs.cpio generated for TestMdnsd doesn't have any ntp client installed, it start with "January 1, 1970". The date change may cause some issue to the mdnsd daemon which blocks any response from mquery command. When the problem occurs, "mquery -T _http._tcp" reply is empty: # mquery -T _http._tcp Querying _http._tcp.local. for PTR (12) ... press Ctrl-C to stop To workaround the issue, restart mdnsd manually. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/16185948555 Signed-off-by: Romain Naour Signed-off-by: Julien Olivain --- support/testing/tests/package/test_mdnsd.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/support/testing/tests/package/test_mdnsd.py b/support/testing/tests/package/test_mdnsd.py index 214eea7dd9..ebb8971e38 100644 --- a/support/testing/tests/package/test_mdnsd.py +++ b/support/testing/tests/package/test_mdnsd.py @@ -23,6 +23,10 @@ class TestMdnsd(infra.basetest.BRTest): "-net", "user"]) self.emulator.login() + # Restart mdnsd after setting the date in emulator.login() setup. + cmd = "/etc/init.d/S50mdnsd restart" + self.assertRunOk(cmd, timeout=30) + # We check the program can execute. self.assertRunOk("mdnsd -v")