Hi, This patch addes warnings in pselect01 and nanosleep02 test cases that the certain failures may due to the limitation of the way it calculates the system call execution time. For example, in pselect01 test case,
start = time(&t); retval = pselect(0, &readfds, NULL, NULL, (struct timespec *)&tv,NULL); end = time(&t); /* Changed total_sec compare to an at least vs an exact compare */ 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)); } "end - start" is not the actual syscall execution time. It could sleep a little bit more, and the task can be preempted before "end = time(&t)". "end - start" maybe even bigger if the system is under load. In addition, looks like pselect01_64 test case does not exist anymore, so I have removed it from the runtest file. Is it correct? Signed-off-by: CAI Qian <[email protected]> --- runtest/syscalls.orig 2009-03-12 22:18:35.000000000 +0800 +++ runtest/syscalls 2009-03-13 13:32:45.000000000 +0800 @@ -700,7 +700,6 @@ profil01 profil01 pselect01 pselect01 -pselect01_64 pselect01_64 ptrace01 ptrace01 ptrace02 ptrace02 --- testcases/kernel/syscalls/pselect/pselect01.c.orig 2009-03-12 22:19:50.000000000 +0800 +++ testcases/kernel/syscalls/pselect/pselect01.c 2009-03-13 13:33:03.000000000 +0800 @@ -129,9 +129,13 @@ /* Changed total_sec compare to an at least vs an exact compare */ 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)); + tst_resm(TPASS,"Sleep time was correct"); + else { + tst_resm(TWARN,"This test could fail if the system was under load"); + tst_resm(TWARN,"due to the limitation of the way it calculates the"); + tst_resm(TWARN,"system call execution time."); + tst_resm(TFAIL,"Sleep time was incorrect:%d != %d",total_sec,(end - start)); + } } cleanup(); return 0; --- testcases/kernel/syscalls/nanosleep/nanosleep02.c.orig 2009-03-12 22:29:44.000000000 +0800 +++ testcases/kernel/syscalls/nanosleep/nanosleep02.c 2009-03-13 13:32:56.000000000 +0800 @@ -214,6 +214,9 @@ elapsed = (ntime.tv_sec - otime.tv_sec) * 1000000 + ntime.tv_usec - otime.tv_usec; if (rem - (req - elapsed) > USEC_PRECISION) { + tst_resm(TWARN,"This test could fail if the system was under load"); + tst_resm(TWARN,"due to the limitation of the way it calculates the"); + tst_resm(TWARN,"system call execution time."); tst_resm(TFAIL, "Remaining sleep time %lu usec doesn't " "match with the expected %lu usec time", rem, (req - elapsed)); @@ -255,6 +258,9 @@ req = timereq.tv_sec * 1000000 + timereq.tv_nsec / 1000; elapsed = (ntime.tv_sec - otime.tv_sec) * 1000000 + ntime.tv_usec - otime.tv_usec; if (elapsed - req > USEC_PRECISION) { + tst_resm(TWARN,"This test could fail if the system was under load"); + tst_resm(TWARN,"due to the limitation of the way it calculates the"); + tst_resm(TWARN,"system call execution time."); tst_resm(TFAIL, "Child execution not " "suspended for %d seconds %lu nanoseconds", timereq.tv_sec, timereq.tv_nsec); ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
