Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,21 @@ public class DatabaseNodeServiceIT extends AbstractGeoIpIT {
public void testNonGzippedDatabase() throws Exception {
String databaseType = "GeoLite2-Country";
String databaseFileName = databaseType + ".mmdb";
// making the dabase name unique so we know we're not using another one:
// making the database name unique so we know we're not using another one:
String databaseName = randomAlphaOfLength(20) + "-" + databaseFileName;
byte[] mmdbBytes = getBytesForFile(databaseFileName);
final DatabaseNodeService databaseNodeService = internalCluster().getInstance(DatabaseNodeService.class);
assertNull(databaseNodeService.getDatabase(databaseName));
int numChunks = indexData(databaseName, mmdbBytes);
retrieveDatabase(databaseNodeService, databaseName, mmdbBytes, numChunks);
assertBusy(() -> assertNotNull(databaseNodeService.getDatabase(databaseName)));
assertValidDatabase(databaseNodeService, databaseName, databaseType);
/*
* If DatabaseNodeService::checkDatabases runs it will sometimes (rarely) remove the database we are using in this test while we
* are trying to assert things about it. So if it does then we 'just' try again.
*/
assertBusy(() -> {
retrieveDatabase(databaseNodeService, databaseName, mmdbBytes, numChunks);
assertNotNull(databaseNodeService.getDatabase(databaseName));
assertValidDatabase(databaseNodeService, databaseName, databaseType);
});
}

/*
Expand All @@ -64,16 +70,22 @@ public void testNonGzippedDatabase() throws Exception {
public void testGzippedDatabase() throws Exception {
String databaseType = "GeoLite2-Country";
String databaseFileName = databaseType + ".mmdb";
// making the dabase name unique so we know we're not using another one:
// making the database name unique so we know we're not using another one:
String databaseName = randomAlphaOfLength(20) + "-" + databaseFileName;
byte[] mmdbBytes = getBytesForFile(databaseFileName);
byte[] gzipBytes = gzipFileBytes(databaseName, mmdbBytes);
final DatabaseNodeService databaseNodeService = internalCluster().getInstance(DatabaseNodeService.class);
assertNull(databaseNodeService.getDatabase(databaseName));
int numChunks = indexData(databaseName, gzipBytes);
retrieveDatabase(databaseNodeService, databaseName, gzipBytes, numChunks);
assertBusy(() -> assertNotNull(databaseNodeService.getDatabase(databaseName)));
assertValidDatabase(databaseNodeService, databaseName, databaseType);
/*
* If DatabaseNodeService::checkDatabases runs it will sometimes (rarely) remove the database we are using in this test while we
* are trying to assert things about it. So if it does then we 'just' try again.
*/
assertBusy(() -> {
retrieveDatabase(databaseNodeService, databaseName, gzipBytes, numChunks);
assertNotNull(databaseNodeService.getDatabase(databaseName));
assertValidDatabase(databaseNodeService, databaseName, databaseType);
});
}

/*
Expand Down
6 changes: 0 additions & 6 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,6 @@ tests:
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
method: test {categorize.Categorize SYNC}
issue: https://github.com/elastic/elasticsearch/issues/113722
- class: org.elasticsearch.ingest.geoip.DatabaseNodeServiceIT
method: testNonGzippedDatabase
issue: https://github.com/elastic/elasticsearch/issues/113821
- class: org.elasticsearch.ingest.geoip.DatabaseNodeServiceIT
method: testGzippedDatabase
issue: https://github.com/elastic/elasticsearch/issues/113752
- class: org.elasticsearch.threadpool.SimpleThreadPoolIT
method: testThreadPoolMetrics
issue: https://github.com/elastic/elasticsearch/issues/108320
Expand Down