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

UPSTREAM: 63875: make TestGetServerGroupsWithTimeout more reliable #19723

Merged
merged 1 commit into from
May 15, 2018

Conversation

deads2k
Copy link
Contributor

@deads2k deads2k commented May 15, 2018

Hopefully fixes the unit test flake we're seeing.

/assign @soltysh

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k

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

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 15, 2018
@deads2k
Copy link
Contributor Author

deads2k commented May 15, 2018

@deads2k
Copy link
Contributor Author

deads2k commented May 15, 2018

/retest

@mfojtik
Copy link
Contributor

mfojtik commented May 15, 2018

wait for tests to be green, LGTM otherwise

@openshift-ci-robot
Copy link

openshift-ci-robot commented May 15, 2018

@deads2k: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
ci/openshift-jenkins/gcp afa872c link /test gcp
ci/openshift-jenkins/extended_conformance_install afa872c link /test extended_conformance_install

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@deads2k
Copy link
Contributor Author

deads2k commented May 15, 2018

test unit is green, this only touches unit tests. manually merging because this flake is crazy common.

@deads2k deads2k merged commit e00803c into openshift:master May 15, 2018
@@ -143,18 +143,18 @@ func TestGetServerGroupsWithTimeout(t *testing.T) {
}))
defer server.Close()
defer close(done)
tmp := defaultTimeout
defaultTimeout = 2 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

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

That here was intentionally to ensure the default is applied out of the box. Without it, there's nothing checking that it is set. I'm ok with extending the error part, but this bit should be brought back.

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's sync tomorrow, I'd like to re-shape this PR before merging upstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That here was intentionally to ensure the default is applied out of the box. Without it, there's nothing checking that it is set. I'm ok with extending the error part, but this bit should be brought back.

We need to check that the feature works, not that a bit of wiring does. Checking that wiring works is simply duplicating code from the original. And global state mutation in a test is a bad pattern.

Copy link
Contributor

Choose a reason for hiding this comment

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

How else you want to ensure the wiring is happening, esp. if it applies only for the dynamic client, but not for regular one? I do agree that global state mutation in tests is a bad pattern, but it's quite frequent all over our code base.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How else you want to ensure the wiring is happening, esp. if it applies only for the dynamic client, but not for regular one?

To be honest, I don't much care. If we have a problem we'll chase it and have an easy spot to wire up the fix. If the functionality works and we're short wiring a default, it's fairly easy to figure out how to connect the bits. Testing wiring is often a duplication of the code its testing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed this in depth with David on IRC, I'm ok with this approach.

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

4 participants