conserver: fix racy console-down ptest

test/test1.cf sets "reinitcheck 1s", added upstream only to exercise
the seconds unit. A reinit check brings back every console that is down,
including one taken down on purpose, so test #5, which expects the
console that test #4 downed ("cd") to still be down, has about a second
to attach and query it. On a loaded host, e.g. while testimage runs
several VMs, it loses:

  FAIL: conserver #5  (diffs in test5.diff)
  -[`shell' -- console is down]

conserver.log shows "[shell] automatic reinitialization" between the
two tests. Reproduced with 2 failures in 20 runs in qemux86-64 with the
host CPUs saturated; instrumenting group.c confirmed the reinit comes
from ReUp(pGE, 2), the reinitcheck timer.

Use "reinitcheck 60s" in the test config, so the seconds unit is still
parsed but the check cannot fire during the ~10 s test run. 40 of 40
runs passed under the same load.

Tested with meta-oe-image-ptest-conserver on qemux86-64 with
yoe-musl-systemd-wayland.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Khem Raj committed 2026-09-27 14:53:52 -07:00
1 parent 93028c860c
commit 0d23ebf994
2 files changed
+38

No files matched your search

@@ -0,0 +1,37 @@
From: Khem Raj <khem.raj@oss.qualcomm.com>
Date: Sun, 27 Sep 2026 14:15:00 -0700
Subject: [PATCH] test: don't let reinitcheck race the console-down test
test1.cf sets "reinitcheck 1s", added to exercise the seconds unit.
A reinit check brings back every console that is down, including one
taken down on purpose, so test #4 ("cd") and test #5, which expects the
console to still be down, race it: if the second console client does
not attach and query the state within a second, conserver has already
reinitialized the console and test #5 fails with
-[`shell' -- console is down]
[Enter `^Ec?' for help]
This shows up readily on loaded or emulated targets. Use 60s instead:
the seconds unit is still parsed and the check can no longer fire
during the test run.
Upstream-Status: Pending
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
test/test1.cf | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/test1.cf b/test/test1.cf
index 781267e..b02a9ba 100644
--- a/test/test1.cf
+++ b/test/test1.cf
@@ -8,7 +8,7 @@ default * {
include full;
}
config * {
- reinitcheck 1s;
+ reinitcheck 60s;
}
break 5 {
string "\rtest\r";
@@ -23,6 +23,7 @@ SRC_URI = "\
git://github.com/bstansell/conserver;protocol=https;branch=master;tag=v${PV} \
file://conserver.service \
file://run-ptest \
file://0001-test-don-t-let-reinitcheck-race-the-console-down-tes.patch \
"
SRCREV = "fe9aac337554f95721dc9f3da721092a81092089"