Skip to content

Commit ae5df84

Browse files
committed
Add a comment
1 parent d7a063c commit ae5df84

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

x-pack/plugin/ilm/src/test/java/org/elasticsearch/xpack/ilm/PolicyStepsRegistryTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,9 @@ public void testGetStepMultithreaded() throws Exception {
502502
for (int i = 0; i < scaledRandomIntBetween(100, 1000); i++) {
503503
LifecycleAction action = randomValueOtherThan(MigrateAction.DISABLED, () -> randomFrom(phase.getActions().values()));
504504
Step step = randomFrom(action.toSteps(client, phaseName, MOCK_STEP_KEY, null));
505+
// if the step's key is different from the previous iteration of the loop, then the cache will be updated, and we'll
506+
// get a non-cached response. if the step's key happens to be the same as the previous iteration of the loop, then
507+
// we'll get a cached response. so this loop randomly tests both cached and non-cached responses.
505508
Step actualStep = registry.getStep(indexMetadata, step.getKey());
506509
assertThat(actualStep.getKey(), equalTo(step.getKey()));
507510
}

0 commit comments

Comments
 (0)