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

[Go] Travis CI failure with Go API client's concurrency test #5102

Open
wing328 opened this issue Mar 17, 2017 · 3 comments
Open

[Go] Travis CI failure with Go API client's concurrency test #5102

wing328 opened this issue Mar 17, 2017 · 3 comments

Comments

@wing328
Copy link
Contributor

wing328 commented Mar 17, 2017

Description

Sometimes, we may get the following test failure in 2.3.0 branch with the Go API client for Petstore:

=== RUN TestDeletePet
--- PASS: TestDeletePet (0.00s)
=== RUN TestConcurrency
--- FAIL: TestConcurrency (1.02s)
	Error Trace:	pet_api_test.go:193
			pet_api_test.go:165
	Error:      	Not equal: 
	            	expected: 0
	            	received: 12348
	Messages:   	Pet id should be equal
	Error Trace:	pet_api_test.go:194
			pet_api_test.go:165
	Error:      	Not equal: 
	            	expected: ""
	            	received: "gopherJohn"
	Messages:   	Pet name should be gopherJohn
	Error Trace:	pet_api_test.go:195
			pet_api_test.go:165
	Error:      	Not equal: 
	            	expected: ""
	            	received: "dead"
	Messages:   	Pet status should be dead
	pet_api_test.go:200: &{404 Not Found 404 HTTP/1.1 1 1 map[Content-Type:[application/json] Server:[Jetty(9.2.9.v20150224)] Date:[Fri, 17 Mar 2017 11:05:59 GMT] Access-Control-Allow-Origin:[*] Access-Control-Allow-Methods:[GET, POST, DELETE, PUT] Access-Control-Allow-Headers:[Content-Type, api_key, Authorization]] 0xc208120440 -1 [chunked] false map[] 0xc20801f790 <nil>}
	pet_api_test.go:182: &{404 Not Found 404 HTTP/1.1 1 1 map[Date:[Fri, 17 Mar 2017 11:05:59 GMT] Access-Control-Allow-Origin:[*] Access-Control-Allow-Methods:[GET, POST, DELETE, PUT] Access-Control-Allow-Headers:[Content-Type, api_key, Authorization] Content-Length:[0] Server:[Jetty(9.2.9.v20150224)]] 0xc208120a00 0 [] false map[] 0xc20801f110 <nil>}
=== RUN TestCreateUser
--- PASS: TestCreateUser (0.00s)
=== RUN TestCreateUsersWithArrayInput
--- PASS: TestCreateUsersWithArrayInput (0.00s)
=== RUN TestGetUserByName
--- PASS: TestGetUserByName (0.00s)
=== RUN TestGetUserByNameWithInvalidID
--- PASS: TestGetUserByNameWithInvalidID (0.00s)
	user_api_test.go:109: &{0       0}
	user_api_test.go:112: &{404 Not Found 404 HTTP/1.1 1 1 map[Access-Control-Allow-Methods:[GET, POST, DELETE, PUT] Access-Control-Allow-Headers:[Content-Type, api_key, Authorization] Content-Type:[application/json] Server:[Jetty(9.2.9.v20150224)] Date:[Fri, 17 Mar 2017 11:05:59 GMT] Access-Control-Allow-Origin:[*]] 0xc208121680 -1 [chunked] false map[] 0xc20801fba0 <nil>}
=== RUN TestUpdateUser
--- PASS: TestUpdateUser (0.01s)
=== RUN TestDeleteUser
--- PASS: TestDeleteUser (0.02s)`

Ref: https://api.travis-ci.org/jobs/212060955/log.txt?deansi=true

Seems like the Go API client has issues with concurrent requests.

Swagger-codegen version

2.3.0

Command line used for generation
Steps to reproduce

Submit a PR and the CI (travis) might failed

Related issues
Suggest a Fix

The issue might be addressed by #5037 but I'm not entirely sure.

cc @antihax

@wing328 wing328 added this to the v2.2.3 milestone Mar 17, 2017
@wing328 wing328 modified the milestones: v2.3.0, v2.2.3 Mar 17, 2017
@antihax
Copy link
Contributor

antihax commented Mar 17, 2017

Not addressed by #5037 yet. May have to remove that test, the code is correct but the endpoints do not seem to handle rapid requests well.

I thought it was an issue on my end since it always passed travis for me.

Where is the code for the endpoint server located? Maybe I can figure out what is causing this.

@wing328
Copy link
Contributor Author

wing328 commented Mar 17, 2017

@antihax I'll comment out the test for the time being.

The Pestore server can be found in https://github.com/swagger-api/swagger-samples under java/java-jersey-jaxrs. Thanks for looking into the issue.

@antihax
Copy link
Contributor

antihax commented Mar 17, 2017

Check swagger-api/swagger-samples#74. Looks like data races in the sample, but i am not familiar with the latest Java.

@wing328 wing328 modified the milestones: v2.3.0, v2.4.0 Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants