]> granicus.if.org Git - check/commitdiff
check_check_sub: sleep during test_eternal
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 2 Jan 2014 02:42:43 +0000 (02:42 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Thu, 2 Jan 2014 02:42:43 +0000 (02:42 +0000)
For some reason on Linux (maybe other systems) if
check_check is canceled (e.g. Ctrl+C) when the test_eternal
is running, check_check will still run in the background
on this test. Because the test is in a tight loop,
it eats lots of CPU. Replacing the busy loop with the sleep
does not fix the problem, but at least when it happens
it will not take lots of CPU.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@989 64e312b2-a51f-0410-8e61-82d0ca0eb02a

tests/check_check_sub.c

index 13cc0ccbb78bf15b23d5cd942c9603674ca3ab36..7da0778332c1ea2d3f45b72428f4fee80081b169 100644 (file)
@@ -434,7 +434,7 @@ START_TEST(test_eternal)
   #define LINENO_eternal _STR(__LINE__)
 {
   for (;;)
-    ;
+    sleep(1);
 }
 END_TEST