From 7ddbf59fbd1d3758f10b56ead0b5d2970911c4a7 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Sat, 9 Nov 2013 02:57:16 +0000 Subject: [PATCH] fix test fail git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1540250 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/index/BasePostingsFormatTestCase.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java index 88c668f4dd9..2ee380e3478 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/index/BasePostingsFormatTestCase.java @@ -1475,7 +1475,9 @@ public abstract class BasePostingsFormatTestCase extends LuceneTestCase { } // Also test seeking the TermsEnum: - for(String term : termFreqs.keySet()) { + // must make copy because this very code sometimes makes puts while iterating?! + Set copy = new HashSet(termFreqs.keySet()); + for(String term : copy) { if (termsEnum.seekExact(new BytesRef(term))) { if (random().nextBoolean()) { docs = termsEnum.docs(null, docs, DocsEnum.FLAG_FREQS);