Skip to content

[frontend] fix(atomic-testing): prevent detection/prevention results leaking across tests sharing the same endpoint (#5080)#5453

Closed
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-detection-results-issue
Closed

[frontend] fix(atomic-testing): prevent detection/prevention results leaking across tests sharing the same endpoint (#5080)#5453
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-detection-results-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

  • Identify CI failure: InjectTargetSearchTest.orFilterGroupCombinationShouldNotReturnAgentThatIsNotTargetOfInject fails due to non-deterministic result ordering
  • Fix assertion at line 351 to use Option.IGNORING_ARRAY_ORDER (consistent with existing pattern in the same file)
  • Run spotless check (pre-existing known issue in DetectionRemediationApiTest.java — not related)
  • Validate with parallel_validation

Copilot AI linked an issue Apr 14, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix detection/prevention results mix-up between tests [frontend] fix(atomic-testing): prevent detection/prevention results leaking across tests sharing the same endpoint Apr 14, 2026
Copilot AI requested a review from Seb-MIGUEL April 14, 2026 13:47
Copilot stopped work on behalf of Seb-MIGUEL due to an error April 15, 2026 06:48
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.65%. Comparing base (ab09627) to head (1918171).
⚠️ Report is 38 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #5453   +/-   ##
=========================================
  Coverage     58.65%   58.65%           
  Complexity     4876     4876           
=========================================
  Files          1031     1031           
  Lines         30481    30481           
  Branches       2267     2267           
=========================================
  Hits          17879    17879           
  Misses        11554    11554           
  Partials       1048     1048           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Seb-MIGUEL Seb-MIGUEL removed their request for review April 16, 2026 12:50
Copilot AI requested a review from Seb-MIGUEL April 16, 2026 13:09
@Seb-MIGUEL Seb-MIGUEL changed the title [frontend] fix(atomic-testing): prevent detection/prevention results leaking across tests sharing the same endpoint [frontend] fix(atomic-testing): prevent detection/prevention results leaking across tests sharing the same endpoint (#5080) Apr 17, 2026
@Seb-MIGUEL Seb-MIGUEL force-pushed the copilot/fix-detection-results-issue branch from a12dfd6 to 4bb7c1a Compare April 20, 2026 08:28
@github-actions
Copy link
Copy Markdown

Thank you for your contribution. This PR is but one step away from being ready for merging: all commits must be PGP-signed. To get started, please see https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

Copilot AI and others added 2 commits April 20, 2026 10:29
…ns to prevent cross-test result pollution

Agent-Logs-Url: https://github.com/OpenAEV-Platform/openaev/sessions/b92ea6e7-35ac-46f5-bb88-f735d8e20b00

Co-authored-by: Seb-MIGUEL <203619865+Seb-MIGUEL@users.noreply.github.com>
@Seb-MIGUEL Seb-MIGUEL force-pushed the copilot/fix-detection-results-issue branch from 4bb7c1a to 1918171 Compare April 20, 2026 08:53
@Seb-MIGUEL Seb-MIGUEL requested a review from antoinemzs April 20, 2026 09:33
Copy link
Copy Markdown
Member

@antoinemzs antoinemzs left a comment

Choose a reason for hiding this comment

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

The proposal is that we always fetch fresh data from the backend based on the triple injectId | targetId | expectationType, which seems a rather blunt solution to the underlying problem.

The mistake in the original code was that the store was queried for all expectations based on the tuple targetId | expectationType which seems to only be missing the injectId filter.

The original code (deleted in the proposal):

getInjectExpectationsByAsset: (id, type) => entities('injectexpectations', state).filter(
  i => (i.get('inject_expectation_asset') === id && i.get('inject_expectation_type') === type),
),

IMO the correct solution would still leverage the store but simply introduce an inject filter to the store query.

export const fetchTargetResultAssetWithAgents = (injectId: string, targetId: string, expectationType: string) => {
const uri = `${ATOMIC_TESTING_URI}/${injectId}/target_results/${targetId}/asset_with_agents?expectationType=${expectationType}`;
return getReferential(schema.arrayOfInjectexpectations, uri)(dispatch);
return simpleCall(uri);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So now we completely bypass the store to always get fresh data from the backend, we probably don't want that. @guillaumejparis @corinnekrych thoughts?

@antoinemzs
Copy link
Copy Markdown
Member

will address it in #5634

@antoinemzs antoinemzs closed this Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detection/Prevention results from a different test

3 participants