|author||anonym <email@example.com>||2016-12-27 20:41:21 +0100|
|committer||anonym <firstname.lastname@example.org>||2016-12-27 20:41:21 +0100|
Make the memory wipe wait reliable again.
I've seen it take longer than the 10m sleep imposed by `debug=wipemem` => the domain is not running when we try to dump the memory and a Libvirt::Error is thrown. Refs: #12067
1 files changed, 6 insertions, 19 deletions
diff --git a/features/step_definitions/erase_memory.rb b/features/step_definitions/erase_memory.rb
index c2b684b..6e446ff 100644
@@ -179,28 +179,15 @@ end
When /^I shutdown and wait for Tails to finish wiping the memory$/ do
- check_if_memory_wipe_finished = Proc.new do
- # Ideally we would want this proc to run in exactly 1s, so that retry_action
- # would take exactly memory_wipe_timeout seconds. But it takes some time
- # to run @screen.type and @screen.find, that depends on the host system,
- # so we can't simply "sleep X".
+ try_for(memory_wipe_timeout, msg: "memory wipe didn't finish, probably the VM crashed") do
# We spam keypresses to prevent console blanking from hiding the
# image we're waiting for
- :operation_name => "Checking if memory wipe has finished",
- rescue MaxRetriesFailure
- puts "Cannot tell if memory wipe completed."
- puts "One possible reason for this is a garbled display,"
- puts "so let's go on and rely on the next steps to check"
- puts "how well memory was wiped."
+ puts "Cannot tell if memory wipe completed. " +
+ "One possible reason for this is a garbled display, " +
+ "so let's go on and rely on the next steps to check " +
+ "how well memory was wiped."