Skip to content

Commit 621a193

Browse files
committed
test: also assert deprecation warning after clusters have been closed.
1 parent 1cb3a9d commit 621a193

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ public Settings transportClientSettings() {
220220

221221
assertClusters(cluster0, cluster1, false);
222222
long seed = randomLong();
223+
boolean shouldAssertSettingsDeprecationsAndWarnings = false;
223224
try {
224225
{
225226
Random random = new Random(seed);
@@ -231,6 +232,7 @@ public Settings transportClientSettings() {
231232
}
232233
assertArrayEquals(cluster0.getNodeNames(), cluster1.getNodeNames());
233234
if (cluster0.getNodeNames().length > 0) {
235+
shouldAssertSettingsDeprecationsAndWarnings = true;
234236
assertSettingDeprecationsAndWarnings(new Setting<?>[]{NetworkModule.HTTP_ENABLED});
235237
}
236238
Iterator<Client> iterator1 = cluster1.getClients().iterator();
@@ -245,6 +247,9 @@ public Settings transportClientSettings() {
245247
cluster1.afterTest();
246248
} finally {
247249
IOUtils.close(cluster0, cluster1);
250+
if (shouldAssertSettingsDeprecationsAndWarnings) {
251+
assertSettingDeprecationsAndWarnings(new Setting<?>[]{NetworkModule.HTTP_ENABLED});
252+
}
248253
}
249254
}
250255

0 commit comments

Comments
 (0)