-
Notifications
You must be signed in to change notification settings - Fork 13
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
e2e: enable goleak check #909
Conversation
@Choraden what's the status? |
I've encountered goleak errors as if the proxy would not close all the goroutines gracefully, but rather a forced shutdown happens. I had no time to investigate it further. |
e2e/setups.go
Outdated
@@ -66,7 +66,8 @@ func SetupDefaults(l *setupList) { | |||
WithProtocol(httpbinScheme)). | |||
AddService( | |||
forwarder.ProxyService(). | |||
WithProtocol(proxyScheme)). | |||
WithProtocol(proxyScheme). | |||
WithGoleak()). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder, why not enable it by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I enabled goleak in a proxy service by default.
utils/compose/cmd.go
Outdated
@@ -106,6 +107,41 @@ func (c *Command) Stop(args ...string) error { | |||
return c.quietRun(c.cmd("stop", args)) | |||
} | |||
|
|||
func (c *Command) ExitedSuccessfully(services []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more useful to export serviceExitCode and add plain functions to do assertions about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
compose.Command now exports ServiceExitCode.
e2e/setup/runner.go
Outdated
if err := cmd.Stop(); err != nil { | ||
return fmt.Errorf("compose stop: %w", err) | ||
} | ||
if err := cmd.ExitedSuccessfully(r.services(s)); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we want to check exit status of all services?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does check exit code of all services.
This is very good progress. |
Unlike the down command, stop does not remove containers, allowing you to check their status.
@mmatczuk I've addressed your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This patch extends compose with functionality to check exit codes of services. It improves tests quality as it enforces that all services exit with code 0. That allows to correctly assert goleak errors.
Fixes #516