<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Joerg, Petr!
<div><br>
</div>
<div>Thanks for reviewing and commenting! I don't have a strong opinion on how the test flow should look like, but I can say this sleep definitely makes the test much more reliable.
</div>
<div><br>
</div>
<div>The results, we get on known to both of you SUSE Carwos, are pretty consistent. My feeling is that 8/10 runs end up with some sporadic failures.
<span class="VIiyi" lang="en"><span class="JLqJ4b ChMk0b" data-language-for-alternatives="en" data-language-to-translate-into="ru" data-phrase-index="2"><span>The fact that extra sleep solves the problem obviously indicates a lack of synchronization.</span></span></span>
</div>
<div><br>
</div>
@Joerg: if you need more info about the environment, please reach out to me.<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
-Bogdan</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Joerg Vehlow <lkml@jv-coder.de><br>
<b>Sent:</b> Friday, August 6, 2021 11:14<br>
<b>To:</b> Petr Vorel <pvorel@suse.cz>; Bogdan Lezhepekov <bogdan.lezhepekov@suse.com><br>
<b>Cc:</b> ltp@lists.linux.it <ltp@lists.linux.it><br>
<b>Subject:</b> Re: [LTP] [PATCH v1] connectors/cn_pec: improve reliability</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Petr,<br>
<br>
On 8/6/2021 9:48 AM, Petr Vorel wrote:<br>
><br>
> If I understand the code correctly, pec_listener keeps receiving msg from PEC<br>
> until got signaled by kill. We generally try to avoid sleep in tests [1].<br>
><br>
> @Joerg: I'm not sure if it's reasonable to add another signal handler in which<br>
> pec_listener would print number of already handled requests (with write() as<br>
> printf() is not reentrant). Then we could loop for certain time before sending INT.<br>
><br>
The problem is, that it is hard to know, if all expected events were <br>
received. pec_listener receives events from all processes.<br>
The only way to reliably handle the issue without sleeping is tracking <br>
exit-events in pec_listener and to tell it to die, once it received an <br>
exit event from event_generator.<br>
Only then we can be sure, that all events generated by the generator <br>
(and hopefully all it's children) were received.<br>
<br>
We could also get rid of the other sleep (after starting the listener <br>
using some kind of synchronization (I guess right after <br>
PROC_CN_MCAST_LISTEN should work). I think checkpoints are not part of <br>
the new lib...<br>
<br>
Joerg<br>
<br>
</div>
</span></font></div>
</body>
</html>