<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:small">Li Wang <<a href="mailto:liwang@redhat.com">liwang@redhat.com</a>> wrote:<br></div></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 18, 2020 at 6:24 PM Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Test allows just 5ms delta for PASS, and test randomly fails in<br>
environments with shared resources and increased steal time.<br>
<br>
Relax the condition and also print deltas if test fails.<br>
Remove DEBUG ifdefs and main parameters to avoid unused variable<br>
warning.<br>
<br>
Signed-off-by: Jan Stancek <<a href="mailto:jstancek@redhat.com" target="_blank">jstancek@redhat.com</a>><br>
---<br>
.../functional/timers/clocks/invaliddates.c | 25 +++++++------------<br>
1 file changed, 9 insertions(+), 16 deletions(-)<br>
<br>
diff --git a/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c b/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c<br>
index face334fd250..d4116b1e9bc0 100644<br>
--- a/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c<br>
+++ b/testcases/open_posix_testsuite/functional/timers/clocks/invaliddates.c<br>
@@ -18,8 +18,7 @@<br>
<br>
#define NUMTESTS 5.<span class="gmail_default" style="font-size:small">..</span><br>
<br>
-#define ACCEPTABLESECDELTA 0<br>
-#define ACCEPTABLENSECDELTA 5000000<br>
+#define ACCEPTABLESECDELTA 2<br></blockquote><div><br></div><div><div style="font-size:small">It's hard to say what size of the second-delta is a proper value, but to increase it can obviously decrease the failure probability. If there is no better way I'd go with this patch. </div></div></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">But in another word, this test is just focused on invalid dates[1], so the deviation(caused by sharing resource) in seconds(even 10 seconds) bound is acceptable I think. </div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If someone insists to make thing more precise, we can make use of function tst_is_virt() to apply this method only for virtual machines. But anyway that's not very important:).</div><div class="gmail_default"><br></div><div class="gmail_default">[1].</div><div class="gmail_default">static int testtimes[NUMTESTS][2] = {<br> {INT32_MAX, 999999999}, // large number<br> {946713600, 999999999}, // Y2K - Jan 1, 2000<br> {951811200, 999999999}, // Y2K - Feb 29, 2000<br> {1078041600, 999999999}, // Y2K - Feb 29, 2004<br> {1049623200, 999999999}, // daylight savings 2003<br></div><div class="gmail_default" style="font-size:small">};</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Regards,<br></div><div>Li Wang<br></div></div></div></div>