neoave / mrack

Multicloud use-case based multihost async provisioner for CIs and testing during development
Apache License 2.0
11 stars 14 forks source link

fix: Handle 403 AuthError (out of quota) in openstack provisioning #255

Closed dav-pascual closed 1 year ago

dav-pascual commented 1 year ago

This modification will catch the Exception, to free all hosts and wait for quota to be available again

pvoborni commented 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.

Tiboris commented 1 year ago

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.

pvoborni commented 1 year ago

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.

dav-pascual commented 1 year ago

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

dav-pascual commented 1 year ago

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.