8000 sqs TestCreateQueueWithAttributes fails randomly due to dependency on map order · Issue #18 · goamz/goamz · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sqs TestCreateQueueWithAttributes fails randomly due to dependency on map order #18

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

Open
billhathaway opened this issue Aug 21, 2014 · 1 comment

Comments

@billhathaway
Copy link

TestCreateQueueWithAttributes asserts the name/values for attribute.1. and attribute.2, but since they are added using a map and then range, it isn't deterministic which order they actually appear when checking the request against the expected values.

This can manifest itself in failures like:
FAIL: sqs_test.go:53: S.TestCreateQueueWithAttributes

sqs_test.go:63:
// TestCreateQueue() tests the core functionality, just check the timeout in this test
c.Assert(req.Form["Attribute.1.Name"], gocheck.DeepEquals, []string{"ReceiveMessageWaitTimeSeconds"})
... obtained []string = []string{"VisibilityTimeout"}
... expected []string = []string{"ReceiveMessageWaitTimeSeconds"}

For me this test passes about 85% of the time (which I think is a go runtime deficiency, it should fail ~ 50% of the time). This test should be changed to not depend on the hash ordering so it will pass all the time.

@mattheath
Copy link
Member

Good catch, this was fixed (to be randomised) in go1.3 as far as I'm aware. Happy to take a PR, otherwise will hopefully get time at the weekend.

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

No branches or pull requests

2 participants
0