From 07157f49c15751ec39246e39ca478549d2135052 Mon Sep 17 00:00:00 2001 From: Martin McGrane Date: Wed, 16 Aug 2023 11:28:25 +1000 Subject: [PATCH] Simplify resize provision validatioin --- src/testpool.jl | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/src/testpool.jl b/src/testpool.jl index 77fdc24..1dd64ea 100644 --- a/src/testpool.jl +++ b/src/testpool.jl @@ -165,8 +165,9 @@ function _validate_engine_pool!() continue end # The engine exists, but is not provisioned despite our best attempts - catch - # The engine does not exist + @warn("$engine was not provisioned. Reported state was <$(response.state)>") + catch e + @warn("$engine was not provisioned. Reported error was <$e>") end # Something went wrong. Remove from the list and attempt to delete delete!(TEST_ENGINE_POOL.engines, engine) @@ -202,6 +203,7 @@ function _create_and_add_engines!(size::Int64) engines[new_name] = 0 end + # Provision separately so we can do it asynchronously @info("Provisioning $(increase) new engines") @sync for new_name in new_names @async try @@ -210,27 +212,6 @@ function _create_and_add_engines!(size::Int64) # Ignore any errors here as we check more thoroughly below end end - - # Test all new engines and remove if they were not successfully provisioned - for new_name in new_names - try - response = get_engine(get_context(), new_name; readtimeout=30) - if response.state == "PROVISIONED" - # Success! Move on and try the next engine - continue - end - # The engine exists, but is not provisioned despite our best attempts - catch e - # The engine does not exist - end - # Something went wrong. Remove from the list and attempt to delete - delete!(engines, new_name) - try - delete_engine(get_context(), new_name; readtimeout=30) - catch - info("Attempted to remove failed engine provision", e) - end - end end end