chaostoolkit / chaostoolkit-lib

The Chaos Toolkit core library
https://chaostoolkit.org/
Apache License 2.0
77 stars 46 forks source link

Attempt to fix `test/test_exit.py` tests by using `pytest-docker` #246

Closed ciaransweet closed 1 month ago

ciaransweet commented 2 years ago

Due to the threading used in tests/test_exit.py, the tests always hang on server.join()

Rather than running an http service in a thread, I'm trying out using pytest-docker to run a http service in a container alongside the tests. Whilst this introduces the need to have docker and docker-compose locally (I don't think that's a massive ask for developers...), it reduces the complexity of the test and doesn't rely on some scary threading

Update

I can confirm that this unblocks the tests locally AND we can now run them in CI builds too (🤙 🤙 🤙 )

To summarise, this PR:

Signed-off-by: Ciaran Evans ciaran@reliably.com

ciaransweet commented 2 years ago

@Lawouach sure, can do!