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 test TestServerGracefulExit #3025

Closed
yurishkuro opened this issue May 21, 2021 · 1 comment · Fixed by #3029
Closed

Flaky test TestServerGracefulExit #3025

yurishkuro opened this issue May 21, 2021 · 1 comment · Fixed by #3029
Labels
bug good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

=== RUN   TestServerGracefulExit
    server_test.go:677: 
        	Error Trace:	server_test.go:677
        	Error:      	Should be true
        	Test:       	TestServerGracefulExit
        	Messages:   	Error log found on server exit: {{error 2021-05-21 19:22:10.814114204 +0000 UTC m=+2.124395084  Could not start HTTP server undefined } [{error 26 0  mux: server closed}]}
--- FAIL: TestServerGracefulExit (1.00s)

Source: ./cmd/query/app/server_test.go:651:func TestServerGracefulExit(t *testing.T)

@yurishkuro yurishkuro added bug help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels May 21, 2021
@albertteoh
Copy link
Contributor

albertteoh commented May 25, 2021

Why is this flaky error showing up now?

Why is it flaky?

  • I think the flakiness comes down to two causes:
    • The call to Close will randomly select either case. The first case returning ErrListenerClosed is considered normal behaviour and won't fail the test. The second case returning ErrServerClosed is not recognized as normal behaviour and so propagates the error, failing the test.
    • The other reason for flakiness is a race condition between when the error is logged and when it is "observed" in the test.

Why does this only relate to the HTTP server?

  • The grpcServer maintains a "connection closed" state, preventing it from propagating the error.
  • cmux server will return "use of closed network connection" when the connection is closed, which is considered normal behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants