This is the mail archive of the
mailing list for the frysk project.
Make TestBreakpoints deterministic
- From: Mark Wielaard <mark at klomp dot org>
- To: frysk at sources dot redhat dot com
- Date: Mon, 21 Aug 2006 15:39:56 +0200
- Subject: Make TestBreakpoints deterministic
The following patch makes TestBreakpoint deterministically PASS on both
my FC5 (x86_64) and FC6test (x86) boxes:
2006-08-21 Mark Wielaard <email@example.com>
* TestBreakpoints.java: Implements Observer.
(procTerminated): New boolean field.
(setup): Add observableProcRemoved to manager.host.
(tearDown): Make sure proc is really gone.
(update): New method.
It seems that under fc6 kernels procs are kept around longer than under
fc5. So we were seeing "about to terminate" procs under fc6 when
restarting the eventloop, which we weren't seeing under fc5 because they
were always already gone. You do sometimes observe this with fc5
kernels, you will get a WARNING: No task for pid XXX from LinuxHost, but
in those cases it seems the terminated event has already happened, or is
never delivered to us. Under fc6 we then will get a terminated event,
which upset this test.
I am still seeing lots of FAILs on my FC6 machine, so it might be that
something similar is generally needed and should go into TestLib.
RCS file: /cvs/frysk/frysk-core/frysk/proc/TestBreakpoints.java,v
retrieving revision 1.1
diff -u -r1.1 TestBreakpoints.java
--- frysk/proc/TestBreakpoints.java 15 Aug 2006 17:16:58 -0000 1.1
+++ frysk/proc/TestBreakpoints.java 21 Aug 2006 13:33:04 -0000
@@ -40,9 +40,12 @@
public class TestBreakpoints
+ implements Observer
// Process id and Proc representation of our test program.
@@ -63,6 +66,9 @@
+ // Whether the proc has really terminited (cannot be seen by the host).
+ boolean procTerminated;
// Monitor to notify and wait on for state of event changes..
static Object monitor = new Object();
@@ -91,6 +97,10 @@
attached = false;
terminating = false;
+ procTerminated = false;
+ // Monitor so we know the proc has really left the building.
// Start an EventLoop so we don't have to poll for events all the time.
eventloop = new EventLoopRunner();
@@ -104,6 +114,22 @@
public void tearDown()
+ // Make sure proc is gone.
+ synchronized (monitor)
+ while (!procTerminated)
+ catch (InterruptedException ie)
+ // Ignored
// Make sure event loop is gone.
@@ -125,6 +151,22 @@
+ // Called by the Host when procs are removed.
+ // Used to monitor whether or not our proc has truely left the building.
+ public void update(Observable o, Object obj)
+ Proc p = (Proc) obj;
+ if (p.equals(proc))
+ synchronized (monitor)
+ procTerminated = true;
public void testHitAndRun() throws IOException