diff mbox series

[meta-oe] conserver: fix racy console-down ptest

Message ID 20260927215335.255230-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe] conserver: fix racy console-down ptest | expand

Commit Message

Khem Raj Sept. 27, 2026, 9:53 p.m. UTC
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>
---
 ...einitcheck-race-the-console-down-tes.patch | 37 +++++++++++++++++++
 .../conserver/conserver_8.3.0.bb              |  1 +
 2 files changed, 38 insertions(+)
 create mode 100644 meta-oe/recipes-connectivity/conserver/conserver/0001-test-don-t-let-reinitcheck-race-the-console-down-tes.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-connectivity/conserver/conserver/0001-test-don-t-let-reinitcheck-race-the-console-down-tes.patch b/meta-oe/recipes-connectivity/conserver/conserver/0001-test-don-t-let-reinitcheck-race-the-console-down-tes.patch
new file mode 100644
index 0000000000..0bb7f99bd1
--- /dev/null
+++ b/meta-oe/recipes-connectivity/conserver/conserver/0001-test-don-t-let-reinitcheck-race-the-console-down-tes.patch
@@ -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";
diff --git a/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb b/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb
index 8ca5d9c95d..8a841bf97e 100644
--- a/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb
+++ b/meta-oe/recipes-connectivity/conserver/conserver_8.3.0.bb
@@ -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"