22
22
23
23
import org .apache .logging .log4j .LogManager ;
24
24
import org .apache .logging .log4j .Logger ;
25
+ import org .apache .lucene .codecs .Codec ;
25
26
import org .apache .lucene .document .Document ;
26
27
import org .apache .lucene .document .Field .Store ;
27
28
import org .apache .lucene .document .StringField ;
28
29
import org .apache .lucene .index .IndexWriter ;
29
30
import org .apache .lucene .index .IndexWriterConfig ;
30
31
import org .apache .lucene .index .SerialMergeScheduler ;
31
32
import org .apache .lucene .store .Directory ;
33
+ import org .apache .lucene .util .TestUtil ;
34
+ import org .elasticsearch .common .lucene .Lucene ;
32
35
import org .elasticsearch .common .unit .ByteSizeValue ;
33
36
import org .elasticsearch .common .unit .TimeValue ;
34
37
import org .elasticsearch .test .ESTestCase ;
@@ -116,7 +119,6 @@ public void testUUIDThreaded(UUIDGenerator uuidSource) {
116
119
assertEquals (count *uuids , globalSet .size ());
117
120
}
118
121
119
- @ AwaitsFix (bugUrl ="https://github.com/elastic/elasticsearch/issues/50048" )
120
122
public void testCompression () throws Exception {
121
123
Logger logger = LogManager .getLogger (UUIDTests .class );
122
124
// Low number so that the test runs quickly, but the results are more interesting with larger numbers
@@ -135,7 +137,7 @@ private static double testCompression(int numDocs, int numDocsPerSecond, int num
135
137
random ().nextBytes (macAddresses [i ]);
136
138
}
137
139
UUIDGenerator generator = new TimeBasedUUIDGenerator () {
138
- double currentTimeMillis = System . currentTimeMillis ( );
140
+ double currentTimeMillis = TestUtil . nextLong ( random (), 0L , 10000000000L );
139
141
140
142
@ Override
141
143
protected long currentTimeMillis () {
@@ -152,6 +154,7 @@ protected byte[] macAddress() {
152
154
// the quality of this test
153
155
Directory dir = newFSDirectory (createTempDir ());
154
156
IndexWriterConfig config = new IndexWriterConfig ()
157
+ .setCodec (Codec .forName (Lucene .LATEST_CODEC ))
155
158
.setMergeScheduler (new SerialMergeScheduler ()); // for reproducibility
156
159
IndexWriter w = new IndexWriter (dir , config );
157
160
Document doc = new Document ();
0 commit comments