Closed dav-pascual closed 1 year ago
Probably looks ok, but would be great to see a test with some mocking which would test that the resources are cleaned when this situation happens.
I believe we can try to set same approach as in https://github.com/neoave/mrack/pull/254 and deliver tests later or create automation to run some tests internally.
We should implement the tests and run them before we release next version. I don't want to see extended usage of internal tests. Better practice is having them with code, running on the changes, catching issues immediately. Also you cannot reproduce these scenarios in production consistently so internal tests are not the solution here.
After further discussion, I will develop a unit test for create_server, while we look forward to close the gaps in the future regarding the untested code
Updated with new unit test. Aditionally refactoring _openstack_gather_responses to fix test warnings "coroutine was never awaited" and improving test exec time by mocking async sleeps calls.
This modification will catch the Exception, to free all hosts and wait for quota to be available again