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

test: TestDeleteOffsetsResponse is brittle and fails periodically #2012

Closed
dnwe opened this issue Sep 9, 2021 · 2 comments · Fixed by #2013
Closed

test: TestDeleteOffsetsResponse is brittle and fails periodically #2012

dnwe opened this issue Sep 9, 2021 · 2 comments · Fixed by #2013

Comments

@dnwe
Copy link
Collaborator

dnwe commented Sep 9, 2021

The new TestDeleteOffsetsResponse looks like it can fail periodically due to a timing issue:

% go test -run 'TestDeleteOffsetsResponse' -v -count=10
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
    request_test.go:96: Encoding no error failed
        got  [0 0 0 0 0 0 0 0 0 1 0 3 98 97 114 0 0 0 2 0 0 0 7 0 0 0 0 0 6 0 0]
        want [0 0 0 0 0 0 0 0 0 1 0 3 98 97 114 0 0 0 2 0 0 0 6 0 0 0 0 0 7 0 0]
--- FAIL: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
=== RUN   TestDeleteOffsetsResponse
--- PASS: TestDeleteOffsetsResponse (0.00s)
FAIL
exit status 1
FAIL    github.com/Shopify/sarama       0.361s

Needs investigating if we can make it more robust.

cc @faillefer

@dnwe
Copy link
Collaborator Author

dnwe commented Sep 9, 2021

Ah it's the randomised ordering of the map of partitions in the response

@faillefer
Copy link
Contributor

@dnwe
Maybe the best correction is to sort by partition when encoding the response. So the result will always be the same.
I can provide a fix

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