Skip to content

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

Open
@wing328

Description

@wing328
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions