Skip to contentSkip to conversation

testsuite/smokey/psostests: Avoid timeouts in over virtual environments

PATCH In review Jan Kiszka 2 participants 2 messages May 4 – May 8

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 testsuite/smokey/psostests: Avoid timeouts in over virtual environments

From: Jan Kiszka <[email protected]>

This was seen over QEMU:

2026-05-03T09:42:36 [2] at mq-3.c:31
2026-05-03T09:42:36    0\"071.079| BUG in __traceobj_assert_failed(): [TSKA] trace assertion failed:
2026-05-03T09:42:36               mq-3.c:32 => \"ret == 0\"
2026-05-03T09:42:36 [1] at mq-3.c:27
2026-05-03T09:42:36 test psostests_mq3 failed: 256

It's most likely that we ran into a timeout here due to QEMU not being able to deliver the messages to all receivers in time. Just wait infinitely in such cases to avoid spurious testsuite errors.

---

Was not worth to bother the AI in this case.

 testsuite/smokey/psostests/mq-3.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
testsuite/smokey/psostests/mq-3.c +8 -2
index 1171a70544..4b6f2dcf35 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -12,6 +14,8 @@ static int tseq[] = {
 
 static u_long tidA, tidB, qid;
 
+static bool on_vm;
+
 static void task_A(u_long a0, u_long a1, u_long a2, u_long a3)
 {
 	u_long msgbuf[4];
@@ -27,7 +31,7 @@ static void task_A(u_long a0, u_long a1, u_long a2, u_long a3)
 	traceobj_mark(&trobj, 1);
 
 	for (n = 0; n < 3; n++) {
-		ret = q_receive(qid, Q_WAIT, 10, msgbuf);
+		ret = q_receive(qid, Q_WAIT, on_vm ? 0 : 10, msgbuf);
 		traceobj_mark(&trobj, 2);
 		traceobj_assert(&trobj, ret == SUCCESS);
 		traceobj_assert(&trobj, msgbuf[0] == n + 1);
@@ -56,7 +60,7 @@ static void task_B(u_long a0, u_long a1, u_long a2, u_long a3)
 	traceobj_mark(&trobj, 4);
 
 	for (n = 0; n < 3; n++) {
-		ret = q_receive(qid, Q_WAIT, 10, msgbuf);
+		ret = q_receive(qid, Q_WAIT, on_vm ? 0 : 10, msgbuf);
 		traceobj_mark(&trobj, 5);
 		traceobj_assert(&trobj, ret == SUCCESS);
 		traceobj_assert(&trobj, msgbuf[0] == n + 1);
@@ -75,6 +79,8 @@ int main(int argc, char *const argv[])
 	u_long args[] = { 1, 2, 3, 4 }, msgbuf[4], count;
 	int ret, n;
 
+	on_vm = argc > 1 && strcmp(argv[1], "--vm") == 0;
+
 	traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
 	ret = q_create("QUEUE", Q_NOLIMIT, 0, &qid);
Signature · 1 line
2.47.3
#1 lore raw
Quoted 63 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

This was seen over QEMU:

2026-05-03T09:42:36 [2] at mq-3.c:31
2026-05-03T09:42:36    0\"071.079| BUG in __traceobj_assert_failed(): [TSKA] trace assertion failed:
2026-05-03T09:42:36               mq-3.c:32 => \"ret == 0\"
2026-05-03T09:42:36 [1] at mq-3.c:27
2026-05-03T09:42:36 test psostests_mq3 failed: 256

It's most likely that we ran into a timeout here due to QEMU not being able to deliver the messages to all receivers in time. Just wait infinitely in such cases to avoid spurious testsuite errors.

---

Was not worth to bother the AI in this case.

 testsuite/smokey/psostests/mq-3.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
testsuite/smokey/psostests/mq-3.c +6 -2
index 1171a70544..4b6f2dcf35 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <copperplate/traceobj.h>
 #include <psos/psos.h>
 
@@ -12,6 +14,8 @@ static int tseq[] = {
 
 static u_long tidA, tidB, qid;
 
+static bool on_vm;
+
 static void task_A(u_long a0, u_long a1, u_long a2, u_long a3)
 {
 	u_long msgbuf[4];
@@ -27,7 +31,7 @@ static void task_A(u_long a0, u_long a1, u_long a2, u_long a3)
 	traceobj_mark(&trobj, 1);
 
 	for (n = 0; n < 3; n++) {
-		ret = q_receive(qid, Q_WAIT, 10, msgbuf);
+		ret = q_receive(qid, Q_WAIT, on_vm ? 0 : 10, msgbuf);
 		traceobj_mark(&trobj, 2);
 		traceobj_assert(&trobj, ret == SUCCESS);
 		traceobj_assert(&trobj, msgbuf[0] == n + 1);
@@ -56,7 +60,7 @@ static void task_B(u_long a0, u_long a1, u_long a2, u_long a3)
 	traceobj_mark(&trobj, 4);
 
 	for (n = 0; n < 3; n++) {
-		ret = q_receive(qid, Q_WAIT, 10, msgbuf);
+		ret = q_receive(qid, Q_WAIT, on_vm ? 0 : 10, msgbuf);
 		traceobj_mark(&trobj, 5);
 		traceobj_assert(&trobj, ret == SUCCESS);
 		traceobj_assert(&trobj, msgbuf[0] == n + 1);

testsuite/smokey/psostests/mq-3.c int main(int argc, char *const argv[]) · line 83

Quoted 5 lines
testsuite/smokey/psostests/mq-3.c +2 -0
@@ -75,6 +79,8 @@ int main(int argc, char *const argv[])
 	u_long args[] = { 1, 2, 3, 4 }, msgbuf[4], count;
 	int ret, n;
 
+	on_vm = argc > 1 && strcmp(argv[1], "--vm") == 0;
+

That is the synchronization point to the other thread / patch. I'm quite sure this never worked as expected. Looking at psostest.c, --vm is never set.

The answer to the question in the other thread is probably: Yes, there were issues with this test on VMs.

Let me try to fix the cmdline argument forwarding.

Quoted 5 lines
testsuite/smokey/psostests/mq-3.c +0 -0
 	traceobj_init(&trobj, argv[0], sizeof(tseq) / sizeof(int));
 
 	ret = q_create("QUEUE", Q_NOLIMIT, 0, &qid);
Signature · 1 line
2.47.3