From a7372e0351f3ba6cfbbbd3b86fccd3325ca26108 Mon Sep 17 00:00:00 2001 From: Sergio Rubio Date: Mon, 18 Mar 2013 15:06:01 +0100 Subject: [PATCH] [digitalocean|compute] improve power state tests reliability power on/off actions are asyncronous and somewhat unreliable so waiting for server state changes to validate tests does not help. Check only if API returns OK when requesting and trust DigitalOcean is doing its thing. --- .../requests/compute/power_state_tests.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tests/digitalocean/requests/compute/power_state_tests.rb b/tests/digitalocean/requests/compute/power_state_tests.rb index f062258d5..0275c744a 100644 --- a/tests/digitalocean/requests/compute/power_state_tests.rb +++ b/tests/digitalocean/requests/compute/power_state_tests.rb @@ -8,24 +8,17 @@ Shindo.tests('Fog::Compute[:digitalocean] | power on/off/shutdown requests', test('#power_off_server') do server.wait_for(120) { ready? } - service.power_off_server(server.id) - server.wait_for(120) { !ready? } - server.status == 'off' + service.power_off_server(server.id).body['status'] == 'OK' end test('#power_on_server') do - service.power_on_server server.id - server.wait_for(120) { ready? } - server.ready? + service.power_on_server(server.id).body['status'] == 'OK' end test('#shutdown_server') do - service.shutdown_server server.id - server.wait_for(120) { !ready? } - server.status == 'off' + service.shutdown_server(server.id).body['status'] == 'OK' end - # restore status server.start end