Using skip() is probably possible, but this mean test won't do it's work, partially or completely. This isn't differ too much from just removing this test. And this will make test unreliable - it may pass even if there is a bug in module, and on next run it may fail and catch this bug. Actually I prefer current behavior - when test may fail because of high system load, but if it pass - that mean module work correctly… for me it's much better than opposite behavior with skip(), when test may pass when there is a bug in module.

As for adding check to analyse overtime, this way lead to implementing very overcomplicated test - it should generate some events at unpredictable points of time to access cache, then it should run some amount of checks, also at unpredictable points of time, and these checks should first calculate expected state of cache at current time and then compare this state to actual state of cache. In addition to be overcomplicated, such test also can't guarantee it will correctly test all functionality of cache - for example, attempt to test item in cache won't expire before expected time will fail if function which checking this will always run too late (after item will be expired from cache). So, we again get unreliable test, plus overcomplicated.


In reply to Re^4: How to write time-related test without race conditions? by powerman
in thread How to write time-related test without race conditions? by powerman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.