Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix race conditions in probe tests. #4786

Merged

Conversation

markusthoemmes
Copy link
Contributor

Fixes #4765

Proposed Changes

These tests had unguarded access to a shared variable from a HTTP handler. As each HTTP handler runs in its own goroutine, that's racy.

This replaces all booleans/counters with atomic counters. Boolean tests are essentially replaced by comparing the counter to be equal to 0.

One occurrence is here: https://prow.knative.dev/view/gcs/knative-prow/logs/ci-knative-serving-continuous/1151252942410485760

Release Note

NONE

These tests had unguarded access to a shared variable from a HTTP handler. As each HTTP handler runs in its own goroutine, that's racy.

This replaces all booleans/counters with atomic counters. Boolean tests are essentially replaced by comparing the counter to be equal to 0.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jul 17, 2019
@knative-prow-robot knative-prow-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 17, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@markusthoemmes: 0 warnings.

In response to this:

Fixes #4765

Proposed Changes

These tests had unguarded access to a shared variable from a HTTP handler. As each HTTP handler runs in its own goroutine, that's racy.

This replaces all booleans/counters with atomic counters. Boolean tests are essentially replaced by comparing the counter to be equal to 0.

One occurrence is here: https://prow.knative.dev/view/gcs/knative-prow/logs/ci-knative-serving-continuous/1151252942410485760

Release Note

NONE

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markusthoemmes

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

The pull request process is described here

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

@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/networking labels Jul 17, 2019
@markusthoemmes
Copy link
Contributor Author

/assign @vagababov

@markusthoemmes
Copy link
Contributor Author

/test pull-knative-serving-unit-tests

Fixed in #4784

@joshrider
Copy link
Contributor

Thank you
😇

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 17, 2019
@knative-prow-robot knative-prow-robot merged commit 3e32973 into knative:master Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/networking cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flaky] knative.dev/serving/test/e2e.TestTargetBurstCapacity
6 participants