in reply to Re^4: How to write time-related test without race conditions?
in thread How to write time-related test without race conditions?
This is not quantum-mechanics. Tests are supposed to be predictable, and the expectations are supposed to be predictable. Tests are supposed to verify your expectations (assumptions).
If you're in overtime, if the cache has expired, then the test expectation must change from ->get('test') returns 1 to ->get('test') returns nothing
Failing the test because you're in overtime is a poorly written test.
EV should make it simple to detect overtime, if it doesn't, you can detect overtime with minimum of code additions to your 30 line test.
But I now see the real problem, you're using EV to implement expiration, but that is something every caching module ( Cache/CHI .. ) knows how to do without an event loop; in short, the module has no use case
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to write time-related test without race conditions?
by powerman (Friar) on May 15, 2012 at 01:41 UTC | |
by Anonymous Monk on May 15, 2012 at 03:07 UTC |