powerman has asked for the wisdom of the Perl Monks concerning the following question:
Question is, how to implement test for this module without race conditions? In test I should check is item was expired/not expired from cache after X seconds. But I can't guarantee when my code actually will be executed - depending on machine load instead of checking cache after N seconds defined in test code actual operation may be done in N+M seconds. And I don't see how to work around this. :(
Update: A friend of mine said it may have sense to check how this issue solved in other modules, like EV itself. I've checked it, and, know what - it's very funny: EV::timer test.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to write time-related test without race conditions?
by Anonymous Monk on May 14, 2012 at 19:53 UTC | |
by powerman (Friar) on May 14, 2012 at 19:56 UTC | |
by Anonymous Monk on May 14, 2012 at 20:30 UTC | |
by powerman (Friar) on May 14, 2012 at 23:20 UTC | |
by Anonymous Monk on May 15, 2012 at 00:00 UTC | |
|