[LTP] [PATCH v2] msgstress01: remove TWARN from runtime remaining

Li Wang liwang@redhat.com
Thu Jun 27 05:14:40 CEST 2024


To mask the issue where a warning is being treated as a failure in CI
logs, we modify the code to change the message type from TWARN to TCONF.

Additionally, we refine the condition under which the test reports as
PASS to ensure that it also accounts for the `stop` flag. This prevents
the test from incorrectly reporting success when it had to stop due to
runtime constraints.

This warning easily happens especaill on debug/slower kernel:

    msgstress01.c:217: TWARN: Out of runtime during forking...

Signed-off-by: Li Wang <liwang@redhat.com>
---
 testcases/kernel/syscalls/ipc/msgstress/msgstress01.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
index 8b1e9a8c0..9231a0b5f 100644
--- a/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
+++ b/testcases/kernel/syscalls/ipc/msgstress/msgstress01.c
@@ -214,7 +214,7 @@ static void run(void)
 			break;
 
 		if (!tst_remaining_runtime()) {
-			tst_res(TWARN, "Out of runtime during forking...");
+			tst_res(TCONF, "Out of runtime during forking...");
 			*stop = 1;
 			break;
 		}
@@ -242,7 +242,7 @@ static void run(void)
 	tst_reap_children();
 	remove_queues();
 
-	if (!(*fail))
+	if (!(*fail) && !(*stop))
 		tst_res(TPASS, "Test passed. All messages have been received");
 }
 
-- 
2.45.2



More information about the ltp mailing list