From: Craig M. <cr...@gh...> - 2008-07-02 18:02:45
|
Every once in a while, pselect01 fails with the following output: FAIL : Sleep time was incorrect:5 != 6 This is because we expect our sleeps of slightly more than 5 seconds to last at most 5 seconds (if we're uninterrupted, integer truncation will mean this only comes up about 1% of the time). To fix this, we should instead expect our sleeps to last between 5 and 6 seconds, as in the patch inlined below. Signed-off-by: Craig Meier <cr...@gh...> svn diff -r 101920:110032 testcases/kernel/syscalls/pselect/pselect01.c Index: testcases/kernel/syscalls/pselect/pselect01.c =================================================================== --- testcases/kernel/syscalls/pselect/pselect01.c (revision 101920) +++ testcases/kernel/syscalls/pselect/pselect01.c (revision 110032) @@ -128,7 +128,7 @@ /* Changed total_sec compare to an at least vs an exact compare */ - if(total_sec >= (end - start)) + if(((end - start) >= total_sec) && ((end - start) <= total_sec + 1)) tst_resm(TPASS,"Sleep time was correct"); else tst_resm(TFAIL,"Sleep time was incorrect:%d != %d",total_sec,(end - start)); |