[Inference API] Handle non-initialized shards in AuthorizationTaskExecutorIT#144736
Conversation
…cutorIT Previous attempts at fixing this issue did not work because I was wrongly assuming that `assertBusy` retried when any exception was thrown. However, it only retries when an `AssertionError` is thrown. The key method in the test that needs to wait for internal inference indices to be created is `getEisEndpoints()`. This commit catches `SearchPhaseExecutionException` and throws an `AssertionError` giving us a chance to retry this when `getEisEndpoints()` is called from within an `assertBusy()`. Closes elastic#144671 Closes elastic#144691 Closes elastic#144731
|
Pinging @elastic/search-inference-team (Team:Search - Inference) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR removes three muted-test entries for AuthorizationTaskExecutorIT from 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| try { | ||
| var endpoints = listener.actionGet(TimeValue.THIRTY_SECONDS); | ||
| return endpoints.stream().filter(m -> m.service().equals(ElasticInferenceService.NAME)).toList(); | ||
| } catch (SearchPhaseExecutionException e) { | ||
| // This can happen if the internal inference indices shards have not been initialized yet. | ||
| // We fail so that when this is called in assertBusy we can retry. | ||
| fail(); | ||
| return List.of(); | ||
| } |
There was a problem hiding this comment.
This really makes me wish we were using JUnit 5 so we could use assertDoesNotThrow() here.
Jan-Kazlouski-elastic
left a comment
There was a problem hiding this comment.
Looks good to me!
…cutorIT (elastic#144736) Previous attempts at fixing this issue did not work because I was wrongly assuming that `assertBusy` retried when any exception was thrown. However, it only retries when an `AssertionError` is thrown. The key method in the test that needs to wait for internal inference indices to be created is `getEisEndpoints()`. This commit catches `SearchPhaseExecutionException` and throws an `AssertionError` giving us a chance to retry this when `getEisEndpoints()` is called from within an `assertBusy()`. Closes elastic#144671 Closes elastic#144691 Closes elastic#144731
…cutorIT (elastic#144736) Previous attempts at fixing this issue did not work because I was wrongly assuming that `assertBusy` retried when any exception was thrown. However, it only retries when an `AssertionError` is thrown. The key method in the test that needs to wait for internal inference indices to be created is `getEisEndpoints()`. This commit catches `SearchPhaseExecutionException` and throws an `AssertionError` giving us a chance to retry this when `getEisEndpoints()` is called from within an `assertBusy()`. Closes elastic#144671 Closes elastic#144691 Closes elastic#144731
This is a manual backport of fixes added in elastic#144312 and elastic#144736.
…cutorIT (elastic#144736) Previous attempts at fixing this issue did not work because I was wrongly assuming that `assertBusy` retried when any exception was thrown. However, it only retries when an `AssertionError` is thrown. The key method in the test that needs to wait for internal inference indices to be created is `getEisEndpoints()`. This commit catches `SearchPhaseExecutionException` and throws an `AssertionError` giving us a chance to retry this when `getEisEndpoints()` is called from within an `assertBusy()`. Closes elastic#144671 Closes elastic#144691 Closes elastic#144731
Previous attempts at fixing this issue did not work because I was wrongly assuming that
assertBusyretried when any exception was thrown. However, it only retries when anAssertionErroris thrown.The key method in the test that needs to wait for internal inference indices to be created is
getEisEndpoints(). This commit catchesSearchPhaseExecutionExceptionand throws anAssertionErrorgiving us a chance to retry this whengetEisEndpoints()is called from within anassertBusy().Closes #144671
Closes #144691
Closes #144731