On Thu, Apr 9, 2009 at 8:57 PM, Matthew Toseland <toad at amphibian.dyndns.org> wrote: > On Thursday 09 April 2009 11:27:04 Daniel Cheng wrote: >> On Thu, Apr 9, 2009 at 6:12 AM, Matthew Toseland >> <toad at amphibian.dyndns.org> wrote: >> > On Wednesday 08 April 2009 16:11:31 Daniel Cheng wrote: >> >> On Wed, Apr 8, 2009 at 8:26 PM, Matthew Toseland >> >> <toad at amphibian.dyndns.org> wrote: >> >> > On Wednesday 08 April 2009 06:04:48 j16sdiz at freenetproject.org wrote: >> >> >> Author: j16sdiz >> >> >> Date: 2009-04-08 05:04:47 +0000 (Wed, 08 Apr 2009) >> >> >> New Revision: 26638 >> >> >> >> >> >> Added: >> >> >>> ? ?trunk/freenet/test/freenet/support/PrioritizedSerialExecutorTest.java >> >> >> Log: >> >> >> JUnit for PrioritizedSerialExecutor >> >> > >> >> > Race conditions??? >> >> >> >> The test case using locks and SynchronousQueue to make sure >> >> the test case are run in the predictable order. >> > >> > And at the expected rate? >> > >> >> not :) >> i have tried my best to make this work in all machines i have access to. > > How about barriers? Don't let it finish a job until the test case tells it it > can?
SynchronousQueue is doing that internally. The problem is not some task finish too fast, it's some task not started when I check for it. (the executor is just sleeping), I have added some Thread.sleep(10) to workaround this, but this is not reliable.