Spurious ECONNREFUSED errors during Glance unit tests
Bug #1108985 reported by
Thierry Carrez
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Invalid
|
High
|
Unassigned |
Bug Description
Got weird errors in unit testing:
ERROR: glance.
requests.
ConnectionError: [Errno 111] ECONNREFUSED
(See https:/
and
ERROR: glance.
error: [Errno 111] ECONNREFUSED
(https:/
Changed in glance: | |
importance: | Undecided → High |
To post a comment you must log in.
This appears to potentially be happening due to two different races.
The first is in TCP port selection for the port given to the various test servers that are started for tested. These ports are determined by opening a socket on port 0, remembering the port it used, then closing the socket. This value is then passed to the server for use. It is possible that something else on the test system opens a socket on that port first.
The second potential race is that the functional tests appear to be exec'ing the test servers. Is it possible that the start_servers method is not waiting for the test servers to come up to the point that they are listening on the ports given to them?
The relavent code appears to begin at: https:/ /github. com/openstack/ glance/ blob/master/ glance/ tests/functiona l/__init_ _.py#L628