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 test flake TestPollResourceStatus #2907

Merged
merged 1 commit into from
Sep 19, 2019

Conversation

tejal29
Copy link
Member

@tejal29 tejal29 commented Sep 18, 2019

Fixes #2906

Description

In this PR, add millisecond duration. By default the duration is Nanosecond which would get exceeded even before CheckStatus had a chance to execute.

Output changes

n/a

Next PRs.

n/a

Test flake run

Before

  1. Ran 100 times
tejaldesai@@skaffold1 (fix_resource_stable)$ go test ./pkg/skaffold/deploy/...  -run ^TestPollResourceStatus$ -count 100
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
--- FAIL: TestPollResourceStatus (0.02s)
    --- FAIL: TestPollResourceStatus/resource_stabilizes (0.01s)
        util.go:69: bool differ (-got, +want):   bool(
            - 	false,
            + 	true,
              )
FAIL
FAIL	github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy	2.259s

After

Ran 1000 times.

tejaldesai@@skaffold1 (fix_resource_stable)$ go test ./pkg/skaffold/deploy/...  -run ^TestPollResourceStatus$ -count 1000
ok  	github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy	30.830s
ok  	github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/kubectl	0.142s [no tests to run]
ok  	github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/resource	0.109s [no tests to run]
tejaldesai@@skaffold1 (fix_resource_stable)$

@codecov
Copy link

codecov bot commented Sep 18, 2019

Codecov Report

Merging #2907 into master will not change coverage.
The diff coverage is n/a.

@tejal29 tejal29 closed this Sep 18, 2019
@tejal29 tejal29 deleted the fix_resource_stable branch September 18, 2019 23:04
@tejal29 tejal29 restored the fix_resource_stable branch September 18, 2019 23:49
@tejal29 tejal29 reopened this Sep 18, 2019
Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@balopat balopat merged commit 95d28f4 into GoogleContainerTools:master Sep 19, 2019
@tejal29 tejal29 deleted the fix_resource_stable branch April 15, 2021 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flake TestPollResourceStatus/resource_stabilizes
3 participants