]> sourceware.org Git - systemtap.git/commitdiff
testsuite: add explicit timeouts to stap session
authorFrank Ch. Eigler <fche@redhat.com>
Tue, 20 Sep 2011 14:21:09 +0000 (10:21 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Tue, 20 Sep 2011 14:26:53 +0000 (10:26 -0400)
With the previous code, it was possible for the delayedkill ./loop job
to be killed before the stap script watching for its end got really
ready.  That could mean that the stap script starts, and waits, and
waits, and waits more, and waits, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits, and waits yet more, and waits, and waits, and waits,
and waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits a bit longer, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits more , and waits,
and waits, and waits, and waits, and waits, and waits, and waits, and
waits, and keeps waiting, and waits, and waits, and waits, and waits,
and waits, and waits, and waits, and goes on waiting, and waits, and
waits a lot, and waits, and waits, and waits, and waits, and waits,
and waits, and waits, and waits for warts, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, now
getting slightly impatient, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits, and waits, and
waits, and waits, and waits, and waits, and waits a lot more.

Since there is no robust synchronization in the test case, let's
increase the delayedkill interval to make the above wait less likely,
plus add a godot timeout probe that will abort the script before it
gets grey hairs, loses its teeth, and gets bombarded with funeral
pre-planning spam.

testsuite/systemtap.unprivileged/unprivileged_myproc.exp

index 8d6e0f122a913a8d6e4f4075fb0b7f3ac72ad3b0..19a9898930b2ff9bc1a5322d5537d8b80c2d05e3 100644 (file)
@@ -214,13 +214,13 @@ proc test_probes { } {
 
        # Test the probe type. If successful, the stap rc will be 0.
        set probe [add_args $probe_type $our_pid]
-       set cmd [concat [list $stap --unprivileged -e "probe $probe { if (is_myproc ()) println (\"is myproc\") else println (\"not myproc\"); exit (); }"] [extra_options $probe_type]]
+       set cmd [concat [list $stap --unprivileged -e "probe $probe { if (is_myproc ()) println (\"is myproc\") else println (\"not myproc\"); exit (); } probe timer.s(15) { println(\"timeout\") exit() }"] [extra_options $probe_type]]
 
        # If the probe types was 'process(number).end' or 'process(string).end' then set up a
        # delayed kill of our test program in order to make the probe fire.
        if {[regexp "^process\\(number\\)\\.end" $probe_type] || \
            [regexp "^process\\(string\\)\\.end" $probe_type]} {
-           exec $srcdir/$subdir/delayedkill $our_pid 5 &
+           exec $srcdir/$subdir/delayedkill $our_pid 10 &
        }
 
        # Run stap.
This page took 0.030223 seconds and 5 git commands to generate.