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 flaky launcher test #2758

Merged
merged 2 commits into from
Nov 8, 2021
Merged

Fix flaky launcher test #2758

merged 2 commits into from
Nov 8, 2021

Conversation

khanhtc1202
Copy link
Member

@khanhtc1202 khanhtc1202 commented Nov 8, 2021

What this PR does / why we need it:

Suspend below flaky test

(12:45:17) FAIL: //pkg/app/launcher/cmd/launcher:go_default_test (see /private/var/tmp/_bazel_/2d45f513ea3114123209fc663da944fe/execroot/pipe/bazel-out/darwin-fastbuild/testlogs/pkg/app/launcher/cmd/launcher/go_default_test/test.log)
(12:45:17) INFO: From Testing //pkg/app/launcher/cmd/launcher:go_default_test:
==================== Test output for //pkg/app/launcher/cmd/launcher:go_default_test:
--- FAIL: TestCommand (0.00s)
    binary_test.go:32: 
                Error Trace:    binary_test.go:32
                Error:          Should be false
                Test:           TestCommand
FAIL
================================================================================

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.10%. This pull request does not change code coverage.


stopAfter := time.Millisecond
cmd.GracefulStop(stopAfter)
time.Sleep(stopAfter)
Copy link
Member

Choose a reason for hiding this comment

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

We should avoid using time.Sleep in tests.
So how about adding <- c.stoppedCh to before this line instead of fixing the test.
https://github.com/pipe-cd/pipe/blob/master/pkg/app/launcher/cmd/launcher/binary.go#L53

Copy link
Member Author

Choose a reason for hiding this comment

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

That's better, thank you. Addressed by de5214b

@pipecd-bot pipecd-bot added size/M and removed size/XS labels Nov 8, 2021
@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.11%. This pull request increases coverage by 0.01%.

File Function Base Head Diff
pkg/app/launcher/cmd/launcher/binary.go command.GracefulStop 66.67% 100.00% +33.33%

@nghialv
Copy link
Member

nghialv commented Nov 8, 2021

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nghialv.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants