]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
make bar_bad tests more deterministic
authorPetar Jovanovic <mips32r2@gmail.com>
Wed, 23 Nov 2016 17:38:29 +0000 (17:38 +0000)
committerPetar Jovanovic <mips32r2@gmail.com>
Wed, 23 Nov 2016 17:38:29 +0000 (17:38 +0000)
Canceling the thread slp2 before the case 5 makes behaviour of this test
more deterministic.
Also, as Philippe W. pointed out, adding --fair-sched=try seems to avoid
variable and sometimes very long run time for these tests.

Related BZ #358213

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16154

drd/tests/bar_bad.vgtest
drd/tests/bar_bad_xml.vgtest
helgrind/tests/bar_bad.c
helgrind/tests/bar_bad.stderr.exp
helgrind/tests/bar_bad.stderr.exp-destroy-hang
helgrind/tests/bar_bad.vgtest

index 14cdf190a0b68f85e36162376ac438fc48db8750..08be06220979a9731121e1f21ccc81a8f9fb2233 100644 (file)
@@ -1,2 +1,3 @@
 prereq: test -e ../../helgrind/tests/bar_bad && ./supported_libpthread
 prog: ../../helgrind/tests/bar_bad
+vgopts: --fair-sched=try
index d626dc34b44606e6d8322274c61b0f28b33747b9..65e5c2d580f490dee130bd608ee55b1efaca4e4c 100644 (file)
@@ -1,4 +1,4 @@
 prereq: test -e ../../helgrind/tests/bar_bad && ./supported_libpthread
-vgopts: --xml=yes --xml-fd=2
+vgopts: --xml=yes --xml-fd=2 --fair-sched=try
 prog: ../../helgrind/tests/bar_bad
 stderr_filter: ../../memcheck/tests/filter_xml
index 19cf81c1daea2899c57c7e33c623fc593ad81ba9..0882b03a16fd9a4887c8ef1de043daaddea5c11a 100644 (file)
@@ -81,6 +81,8 @@ int main ( void )
   /* and now destroy */
   pthread_barrier_destroy(bar4);
 
+  pthread_cancel(slp2);
+
   /* destroy a barrier that was never initialised.  This is a bit
      tricky, in that we have to fill the barrier with bytes which
      ensure that the pthread_barrier_destroy call doesn't crash for
index d0901b23318613ddff5cfe2114f0ade7d72c020f..a675a18df059a05759435a3b02afefe0ec10ef53 100644 (file)
@@ -60,5 +60,5 @@ destroy a barrier that was never initialised
 
 Thread #x: pthread_barrier_destroy: barrier was never initialised
    at 0x........: pthread_barrier_destroy (hg_intercepts.c:...)
-   by 0x........: main (bar_bad.c:96)
+   by 0x........: main (bar_bad.c:98)
 
index ddf5624265f927aaadc00a34e221079a4dd39a1e..f76663fbaea66e658f3444d21c6abaa03007ecd5 100644 (file)
@@ -68,5 +68,5 @@ destroy a barrier that was never initialised
 
 Thread #x: pthread_barrier_destroy: barrier was never initialised
    at 0x........: pthread_barrier_destroy (hg_intercepts.c:...)
-   by 0x........: main (bar_bad.c:96)
+   by 0x........: main (bar_bad.c:98)
 
index fe946f55b925ea00f2ef02ca9474e967d6443dc8..cb3a1ca4536301d21442f9bf743f02e0cc8b8d65 100644 (file)
@@ -1,3 +1,3 @@
 prereq: test -e bar_bad
 prog: bar_bad
-vgopts: -q
+vgopts: -q --fair-sched=try