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

Flaky: TestControllerGameServersNodeState #1805

Conversation

markmandel
Copy link
Collaborator

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking

/kind bug

/kind cleanup
/kind documentation
/kind feature
/kind hotfix

What this PR does / Why we need it:

This involves two things:

(1) Adding a newFakeControllerWithMock to the metric test utilities to allow for pre-population -- which with the client-go updates make it far easier to write deterministic tests.

(2) Updated TestControllerGameServersNodeState with the new mock construction.

This included removing the c.run() command, which can run c.collect() at any point in time, and any number of times before the tests being checked, and replaced this a c.collect() so we can control exactly when metric collection occurs during the tests.

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

Ran this a few hundred times, no failures.

This involves two things:

(1) Adding a newFakeControllerWithMock to the metric test utilities to
allow for pre-population -- which with the client-go updates make it far
easier to write deterministic tests.

(2) Updated TestControllerGameServersNodeState with the new mock
construction.

This included removing the c.run() command, which can run c.collect() at
any point in time, and any number of times before the tests being
checked, and replaced this a c.collect() so we can control exactly when
metric collection occurs during the tests.
@markmandel markmandel added kind/bug These are bugs. area/tests Unit tests, e2e tests, anything to make sure things don't break labels Sep 11, 2020
@markmandel markmandel requested a review from aLekSer September 11, 2020 18:33
@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: ce505c13-372f-462e-966f-cf6c40955e05

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/1805/head:pr_1805 && git checkout pr_1805
  • helm install ./install/helm/agones --namespace agones-system --name agones --set agones.image.tag=1.9.0-d97821f

Copy link
Collaborator

@aLekSer aLekSer left a comment

Choose a reason for hiding this comment

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

Thanks for the test fix, this func c.collect() looks much more appropriate for the tests now.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aLekSer, markmandel

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

@aLekSer aLekSer merged commit eec514d into googleforgames:master Sep 11, 2020
@markmandel markmandel added this to the 1.9.0 milestone Sep 11, 2020
@markmandel markmandel deleted the wip/flaky-TestControllerGameServersNodeState branch September 11, 2020 19:26
ilkercelikyilmaz pushed a commit to ilkercelikyilmaz/agones that referenced this pull request Oct 23, 2020
This involves two things:

(1) Adding a newFakeControllerWithMock to the metric test utilities to
allow for pre-population -- which with the client-go updates make it far
easier to write deterministic tests.

(2) Updated TestControllerGameServersNodeState with the new mock
construction.

This included removing the c.run() command, which can run c.collect() at
any point in time, and any number of times before the tests being
checked, and replaced this a c.collect() so we can control exactly when
metric collection occurs during the tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved area/tests Unit tests, e2e tests, anything to make sure things don't break cla: yes kind/bug These are bugs. lgtm size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants