Re: [PATCH] testsuite/smokey/alchemytests: Relax mq-2 test over VM

Jan Kiszka <[email protected]>
Newsgroups dev.linux.lists.xenomai
Message-ID <[email protected]>
On 08.05.26 09:43, Florian Bezdeka wrote:
> On Thu, 2026-05-07 at 14:53 +0200, Jan Kiszka wrote:
>> On 07.05.26 14:35, Florian Bezdeka wrote:
>>> On Thu, 2026-05-07 at 14:23 +0200, Jan Kiszka wrote:
>>>> On 07.05.26 13:03, Florian Bezdeka wrote:
>>>>> On Wed, 2026-05-06 at 12:26 +0200, Jan Kiszka wrote:
>>>>>> From: Jan Kiszka <[email protected]>
>>>>>>
>>>>>> VM environment may delay or reorder the execution of tasks, so relax the
>>>>>> checks.
>>>>>>
>>>>>> Part of #52.
>>>>>>
>>>>>> Signed-off-by: Jan Kiszka <[email protected]>
>>>>>> ---
>>>>>>  testsuite/smokey/alchemytests/mq-2.c | 8 ++++++--
>>>>>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/testsuite/smokey/alchemytests/mq-2.c b/testsuite/smokey/alchemytests/mq-2.c
>>>>>> index a389e46db0..09b26b2135 100644
>>>>>> --- a/testsuite/smokey/alchemytests/mq-2.c
>>>>>> +++ b/testsuite/smokey/alchemytests/mq-2.c
>>>>>> @@ -7,6 +7,7 @@
>>>>>>  #include <alchemy/queue.h>
>>>>>>  
>>>>>>  static struct traceobj trobj;
>>>>>> +static bool on_vm;
>>>>>>  
>>>>>>  static int tseq[] = {
>>>>>>  	3, 4, 5, 6,
>>>>>> @@ -87,9 +88,10 @@ static void main_task(void *arg)
>>>>>>  
>>>>>>  	ret = rt_queue_inquire(&q, &info);
>>>>>>  	traceobj_check(&trobj, ret, 0);
>>>>>> -	traceobj_assert(&trobj, info.nmessages == 0);
>>>>>> +	traceobj_assert(&trobj, info.nmessages == 0 || on_vm);
>>>>>>  
>>>>>> -	traceobj_verify(&trobj, tseq, sizeof(tseq) / sizeof(int));
>>>>>> +	if (info.nmessages == 0)
>>>>>> +		traceobj_verify(&trobj, tseq, sizeof(tseq) / sizeof(int));
>>>>>>  
>>>>>>  	traceobj_exit(&trobj);
>>>>>>  }
>>>>>> @@ -99,6 +101,8 @@ int main(int argc, char *const argv[])
>>>>>>  	RT_TASK t_main;
>>>>>>  	int ret;
>>>>>>  
>>>>>> +	on_vm = argc > 1 && strcmp(argv[1], "--vm") == 0;
>>>>>> +
>>>>>
>>>>> Seems a bit risky to expect --vm as first argument only.
>>>>>
>>>>
>>>> It's not a new pattern, and I thought (please prove me wrong) that this
>>>> is already a filtered argv, freed from generic switches.
>>>
>>> Yes, that seems to be the case, but the filtering seems questionable:
>>>
>>> Taken from run_alchemytests():
>>>
>>> 	tmp = smokey_run_extprog(XENO_TEST_DIR, tests[i],
>>> 				 smokey_on_vm ? args : args + 5,
>>> 				 &test_ret);
>>>
>>> Where args is
>>>
>>> 	const char *args = "--vm";
>>>
>>> args + 5 is pointing to garbage in case smokey_on_vm is false. Right?
>>
>> Yeah, went unnoticed in via 61fc9ff4b7214fb1d9802aa7d177a555f0ad47e3.
>> Please fix and also check the other tests at that chance.
>>
> 
> testsuite/smokey/psostests/mq-3.c has also a check for --vm in argv[1]
> but never got this cmdline parameter...
> 
> Should I remove the check or fix the cmdline arg invocation? Were there
> any issues seen with this specific test (in CI) in the past?

That's a fail of my recent patch, you already commented on it. Still in
next, let me bake a v2.

Jan

-- 
Siemens AG, Foundational Technologies
Linux Expert Center
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.