<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I think the tests can be improved to fail rather than entering an endless loop this way:</div><div><br></div><div>Original:</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp;do {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; TestingUtil.sleepRandom(1000);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; entry = store.load(key);</div><div>&nbsp;&nbsp; &nbsp; &nbsp;} while (!entry.getValue().equals(value + (number-1)));</div><div><br></div><div><br></div><div>New version, allows a timeout of aprox 60 seconds:</div><div><br></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp;boolean success = false;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;for (int i = 0; i &lt; 120; i++) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; TestingUtil.sleepRandom(1000);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; entry = store.load(key);</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; success = entry.getValue().equals(value + (number-1));</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; if (success) break;</div><div>&nbsp;&nbsp; &nbsp; &nbsp;}</div><div>&nbsp;&nbsp; &nbsp; &nbsp;assert success;</div><div><br></div><div>I know TestNG supports timeouts at test method level, never used it though...</div></div><div><br></div></div><div><div>On Oct 28, 2009, at 11:53 AM, Mircea Markus wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div>There is an endless loop in this method.<div>the test puts multiple values on the same key in a cache store and expects (forever) until the store contains the very last value added.</div><div>I'm being able to reproduce this on my Mac quite easily (&lt; 10 runs).</div><div>If anyone feels like taking a look, otherwise I can approach it once I'm done with&nbsp;<a href="https://jira.jboss.org/jira/browse/ISPN-236">ISPN-236</a>                                                                 <a href="https://jira.jboss.org/jira/browse/ISPN-236" style="text-decoration: none;">cache.putIfAbsent() is not atomic</a></div><div><br></div><div><a href="https://jira.jboss.org/jira/browse/ISPN-236" style="text-decoration: none;"></a>Cheers,</div><div>Mircea<br></div></div></blockquote><div><br></div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><br></div></div></div>_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev</blockquote></div><br></body></html>