Intermittent test failures in t/pmc/nci.t
Stefan Seifert
nine at detonation.org
Sun Nov 27 12:20:53 UTC 2011
On Saturday 26 November 2011 11:48:30 Jonathan Duke Leto wrote:
> Howdy,
>
> This test needs a refactoring. It fails roughly every fifth time on my
> laptop.
I had a look at it and alas, it was green_threads related. The test tests
asynchronous callbacks which get scheduled as tasks. Seems like Chandon
stumbled over it as well and added a sleep 0.001 which gave the scheduler a
chance to stop the current task and work through all the posted async
callbacks. But one millisecond might not be enough time on a slow or loaded
system to get all callbacks done. On expiry of the alarm, the interrupted Task
gets scheduled for immediate execution again, so the next test could start
before all callbacks are done.
I fixed it by calling pass in a loop until the callbacks are all done. I have
to say, though this test is written quite cleverly, it very much depends on
the current implementation of scheduling. But for the time being it should run
reliably.
Stefan
More information about the parrot-dev
mailing list