Skip to content

Commit e76fe9c

Browse files
committed
Removed checkForUnexpectedlyRecreatedObjects()
1 parent be0e28c commit e76fe9c

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

tests/Utility.php

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -167,42 +167,6 @@ public static function cleanUpCluster(Client $client): void
167167
self::ensureNoInitializingShards($client);
168168
self::wipeCluster($client);
169169
self::waitForClusterStateUpdatesToFinish($client);
170-
self::checkForUnexpectedlyRecreatedObjects($client);
171-
}
172-
173-
/**
174-
* This method checks whether ILM policies or templates get recreated after they have been deleted. If so, we are probably deleting
175-
* them unnecessarily, potentially causing test performance problems. This could happen for example if someone adds a new standard ILM
176-
* policy but forgets to put it in the exclusion list in this test.
177-
*
178-
* @see ESRestTestCase.java:checkForUnexpectedlyRecreatedObjects()
179-
*/
180-
private static function checkForUnexpectedlyRecreatedObjects(Client $client): void
181-
{
182-
if (self::$hasIlm) {
183-
$policies = self::getAllUnexpectedIlmPolicies($client);
184-
if (!empty($policies)) {
185-
throw new Exception(sprintf(
186-
"Expected no ILM policies after deletions, but found %s",
187-
implode(',', array_keys($policies))
188-
));
189-
}
190-
}
191-
}
192-
193-
/**
194-
* @see ESRestTestCase.java:getAllUnexpectedIlmPolicies()
195-
*/
196-
private static function getAllUnexpectedIlmPolicies(Client $client): array
197-
{
198-
try {
199-
return $client->ilm()->getLifecycle()->asArray();
200-
} catch (ClientResponseException $e) {
201-
if (in_array($e->getCode(), [400, 405])) {
202-
return [];
203-
}
204-
throw $e;
205-
}
206170
}
207171

208172
/**

0 commit comments

Comments
 (0)