Fix async fire-and-forget in SecurityFeatureResetTests that races with teardown's FixedBitSet check#145063
Merged
ebarlas merged 11 commits intoelastic:mainfrom Mar 31, 2026
Merged
Conversation
…h teardown's FixedBitSet check
Collaborator
|
Pinging @elastic/es-security (Team:Security) |
n1v0lg
approved these changes
Mar 30, 2026
| public void testFeatureResetNoManageRole() { | ||
| final ResetFeatureStateRequest req = new ResetFeatureStateRequest(TEST_REQUEST_TIMEOUT); | ||
|
|
||
| PlainActionFuture<ResetFeatureStateResponse> future = new PlainActionFuture<>(); |
Contributor
There was a problem hiding this comment.
Total nit but I think the client interface provides a sync method, i.e. we can do:
Exception e = expectThrows(
Exception.class,
client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("usr", SUPER_USER_PASSWD)))
.admin()
.cluster()
.execute(TransportResetFeatureStateAction.TYPE, req)
);here.
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Mar 31, 2026
…rics
* upstream/main: (21 commits)
Mute org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT test {csv-spec:external-basic.topSnippetsFunction} elastic#145353
Mute org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT test {csv-spec:external-basic.scoreFunction} elastic#145352
[DiskBBQ] Fix bug in NeighborQueue#popRawAndAddRaw (elastic#145324)
Fix dense_vector default index options when using BFLOAT16 (elastic#145202)
Use checked exceptions in entitlement constructor rules (elastic#145234)
ESQL: DS: datasource file plugins should not return TEXT types (elastic#145334)
Plumb DLM error store through to DlmFrozenTransition classes (elastic#145243)
Make Settings.Builder.remove() fluent (elastic#145294)
Add FLS tests for METRICS_INFO and TS_INFO (elastic#145211)
Fix flaky SecurityFeatureResetTests (elastic#145063)
[DOCS] Fix conflict markers in ESQL processing command list (elastic#145338)
Skip certain metric assertions on Windows (elastic#144933)
[ES|QL] Add schema reconciliation for multi-file external sources (elastic#145220)
Simplify DiskBBQ dynamic visit ratio to linear (elastic#142784)
ESQL: Disallow unmapped_fields=load with partial non-KEYWORD (elastic#144109)
[Transform] Track Linked Projects (elastic#144399)
Fix bulk scoring to process last batch instead of falling through to scalar tail (elastic#145316)
Clean up TickerScheduleEngineTests (elastic#145303)
[CI] ShardBulkInferenceActionFilterIT testRestart - Ensuring that secrets-inference index is available after full restart and unmuting test (elastic#145317)
Add CRUD doc to the DistributedArchitectureGuide (elastic#144710)
...
seanzatzdev
pushed a commit
to seanzatzdev/elasticsearch
that referenced
this pull request
Mar 31, 2026
Tests fired feature reset requests fire-and-forget via an async ActionListener, so assertions might never execute and the reset could still be in-flight during teardown. This raced with ensureEstimatedStats() checking FixedBitSet cache size before pending requests were drained, causing a flaky assertion. Fix by blocking on PlainActionFuture until the reset completes.
seanzatzdev
pushed a commit
to seanzatzdev/elasticsearch
that referenced
this pull request
Mar 31, 2026
Tests fired feature reset requests fire-and-forget via an async ActionListener, so assertions might never execute and the reset could still be in-flight during teardown. This raced with ensureEstimatedStats() checking FixedBitSet cache size before pending requests were drained, causing a flaky assertion. Fix by blocking on PlainActionFuture until the reset completes.
ncordon
pushed a commit
to ncordon/elasticsearch
that referenced
this pull request
Apr 1, 2026
Tests fired feature reset requests fire-and-forget via an async ActionListener, so assertions might never execute and the reset could still be in-flight during teardown. This raced with ensureEstimatedStats() checking FixedBitSet cache size before pending requests were drained, causing a flaky assertion. Fix by blocking on PlainActionFuture until the reset completes.
mromaios
pushed a commit
to mromaios/elasticsearch
that referenced
this pull request
Apr 9, 2026
Tests fired feature reset requests fire-and-forget via an async ActionListener, so assertions might never execute and the reset could still be in-flight during teardown. This raced with ensureEstimatedStats() checking FixedBitSet cache size before pending requests were drained, causing a flaky assertion. Fix by blocking on PlainActionFuture until the reset completes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tests in
SecurityFeatureResetTestsfired the feature reset request using an asyncActionListenerwithout waiting for the response. This meant:ensureEstimatedStats()which checksFixedBitSetcache size beforeassertRequestsFinished()drains pending requests.The
.security-7index contains a nested field (realm_domain.realms) whoseBitsetFilterCachewarmer eagerly loads 16-byteFixedBitSetentries. When the async reset hasn't cleaned up the index by the time the teardown check runs, the non-zero bitset memory triggers the flaky assertion.Fix: use
PlainActionFutureto block until the reset completes before the test method returns.