Skip to content

Fix test flake TestPollResourceStatus#2907

Merged
balopat merged 1 commit intoGoogleContainerTools:masterfrom
tejal29:fix_resource_stable
Sep 19, 2019
Merged

Fix test flake TestPollResourceStatus#2907
balopat merged 1 commit intoGoogleContainerTools:masterfrom
tejal29:fix_resource_stable

Conversation

@tejal29
Copy link
Copy Markdown
Contributor

@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
Copy Markdown

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
Copy Markdown
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