mirror of https://github.com/apache/lucene.git
LUCENE-1348: relax TestTimeLimitedCollector.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@682619 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0eb1be2b48
commit
82c1724efb
|
@ -257,6 +257,8 @@ Test Cases
|
|||
Within this fix, "greedy" flag was added to TimeLimitedCollector, to allow the wrapped
|
||||
collector to collect also the last doc, after allowed-tTime passed. (Doron Cohen)
|
||||
|
||||
2. LUCENE-1348: relax TestTimeLimitedCollector to not fail due to
|
||||
timeout exceeded (just because test machine is very busy).
|
||||
|
||||
======================= Release 2.3.2 2008-05-05 =======================
|
||||
|
||||
|
|
|
@ -185,12 +185,17 @@ public class TestTimeLimitedCollector extends LuceneTestCase {
|
|||
// a) Not too early
|
||||
assertTrue ( "elapsed="+timoutException.getTimeElapsed()+" <= (allowed-resolution)="+(TIME_ALLOWED-TimeLimitedCollector.getResolution()),
|
||||
timoutException.getTimeElapsed() > TIME_ALLOWED-TimeLimitedCollector.getResolution());
|
||||
// b) Not too late (this part might be problematic in a busy system, consider removing it if it raises false test failures.
|
||||
assertTrue ( "lastDoc="+exceptionDoc+
|
||||
// b) Not too late.
|
||||
// This part is problematic in a busy test system, so we just print a warning.
|
||||
// We already verified that a timeout occurred, we just can't be picky about how long it took.
|
||||
if (timoutException.getTimeElapsed() > maxTime(multiThreaded)) {
|
||||
System.out.println("Informative: timeout exceeded (no action required: most probably just " +
|
||||
" because the test machine is slower than usual): " +
|
||||
"lastDoc="+exceptionDoc+
|
||||
" ,&& allowed="+timoutException.getTimeAllowed() +
|
||||
" ,&& elapsed="+timoutException.getTimeElapsed() +
|
||||
" >= " + maxTimeStr(multiThreaded),
|
||||
timoutException.getTimeElapsed() < maxTime(multiThreaded));
|
||||
" >= " + maxTimeStr(multiThreaded));
|
||||
}
|
||||
}
|
||||
|
||||
private long maxTime(boolean multiThreaded) {
|
||||
|
|
Loading…
Reference in New Issue