Skip to content

[test] don't pass the t's logger to the adapter#9016

Open
maschmid wants to merge 1 commit intoknative:mainfrom
maschmid:maschmid-fix-adapter-test-data-race
Open

[test] don't pass the t's logger to the adapter#9016
maschmid wants to merge 1 commit intoknative:mainfrom
maschmid:maschmid-fix-adapter-test-data-race

Conversation

@maschmid
Copy link
Copy Markdown
Contributor

fixing a data race, as seen e.g. in https://prow.knative.dev/view/gcs/knative-prow/logs/continuous_eventing_main_periodic/2042044786172497920

don't tie the test context's logger to the adapter. The failFast adapter Start by design terminates as soon as the first watch failure occurs, so it doesn't wait for the other watches to stop. The a.logger.Error("reflector exited: %v", err) may then be invoked on the test logger after the test has already finished, thus causing a "data race"

as the adapter may still run and log with the logger after the test is
done, thus causing a data race
@knative-prow knative-prow bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Apr 10, 2026
@knative-prow knative-prow bot requested review from Leo6Leo and creydr April 10, 2026 16:16
@knative-prow
Copy link
Copy Markdown

knative-prow bot commented Apr 10, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maschmid
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.04%. Comparing base (30cd193) to head (4837504).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9016   +/-   ##
=======================================
  Coverage   51.04%   51.04%           
=======================================
  Files         409      409           
  Lines       21986    21986           
=======================================
  Hits        11223    11223           
  Misses       9902     9902           
  Partials      861      861           

☔ 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant