Skip to content

Conversation

davidkyle
Copy link
Member

Tests that assert certain messages are audited can fail because the test clean up can leak into the next test. When this happens the first few auditor messages of the current test are deleted by the reset request that has leaked from the previous test.

The fix is to add an explicit auditor reset action and call that rather than using the cluster state to communicate the reset request. This guarantees the auditor has been reset in the test clean up.

Closes #134001 #129457 #128166

@davidkyle davidkyle added >test Issues or PRs that are addressing/adding tests :ml Machine learning v9.3.0 labels Oct 10, 2025
@elasticsearchmachine elasticsearchmachine added the Team:ML Meta label for the ML team label Oct 10, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

abstract class AbstractMlAuditor<T extends AbstractAuditMessage> extends AbstractAuditor<T> {

private static final Logger logger = LogManager.getLogger(AbstractMlAuditor.class);
private volatile boolean isResetMode;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isResetMode logic does not appear to be necessary and is removed it to avoid sending 2 different messages (the first to enable reset mode and the second to disable it). CI may tell a different story.

@przemekwitek przemekwitek self-assigned this Oct 10, 2025
Copy link
Contributor

@przemekwitek przemekwitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@przemekwitek przemekwitek removed their assignment Oct 10, 2025
@davidkyle davidkyle merged commit 5b01230 into elastic:main Oct 13, 2025
34 checks passed
georgewallace pushed a commit to georgewallace/elasticsearch that referenced this pull request Oct 13, 2025
Adds auditor reset action for deterministic resets in tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:ml Machine learning Team:ML Meta label for the ML team >test Issues or PRs that are addressing/adding tests v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] ClassificationIT testWithCustomFeatureProcessors failing

3 participants