Possible flakey test test_init_swarm_with_ca_config
Open
Nobody has claimed this yet.
kind/bug
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
https://github.com/docker/docker-py/pull/2288 initially failed with:
=================================== FAILURES ===================================
___________________ SwarmTest.test_init_swarm_with_ca_config ___________________
tests/integration/api_swarm_test.py:60: in test_init_swarm_with_ca_config
assert self.init_swarm(swarm_spec=spec)
tests/integration/base.py:128: in init_swarm
return self._init_swarm(self.client, **kwargs)
tests/integration/base.py:95: in _init_swarm
'127.0.0.1', listen_addr=helpers.swarm_listen_addr(), **kwargs
docker/utils/decorators.py:34: in wrapper
return f(self, *args, **kwargs)
docker/api/swarm.py:129: in init_swarm
self._raise_for_status(response)
docker/api/client.py:263: in _raise_for_status
raise create_api_error_from_http_exception(e)
docker/errors.py:31: in create_api_error_from_http_exception
raise cls(e, response=response, explanation=explanation)
E APIError: 503 Server Error: Service Unavailable ("Swarm is encrypted and needs to be unlocked before it can be used. Please use "docker swarm unlock" to unlock it.")
It passed on repeat.
I would hypothesise that there is perhaps a race in the test between the "swarm init" and "swarm inspect" where the init is not fully complete.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/integration/api_swarm_test.py, especially SwarmTest.test_init_swarm_with_ca_config, then inspect tests/integration/base.py around init_swarm and _init_swarm. Run the integration test repeatedly and investigate the suspected timing between swarm init and swarm inspect. Done means the test no longer fails intermittently when the swarm uses CA configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- distributed-systems, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100