On Dec 31, 2007, at 11:57 AM, chromatic wrote:
On Monday 31 December 2007 05:50:47 Allison Randal wrote:
In the concurrency work I'm about to check in, I have some tests that
fail intermittently because they test for something like:
1
alarm1
2
alarm2
3
alarm3
alarm1
alarm3
4
alarm3
alarm3
alarm3
5
done.
When the actual output is something like:
1
2
alarm1
3
alarm2
4
alarm3
alarm1
5
alarm3
done.
alarm3
alarm3
alarm3
Everything that should happen is happening, just not in the expected
order, or even in a consistent order from one test run to the
next. It's
asynchronous code, so there isn't any guaranteed order.
It sounds like the tests shouldn't print but instead set flag
variables and
then something at the end can check those flags and then report
success or
failure.
Would it be useful to pipe the output through sort and then check for
an exact string match?
Josh