From 59f6ebbc49fc8914f4315c8341c603b2e3226046 Mon Sep 17 00:00:00 2001
From: intrigeri <intrigeri@riseup.net>
Date: Thu, 16 Jan 2025 15:49:06 +0000
Subject: [PATCH] Test suite: Bump the time we wait before checking memory
 poisoning, again

Waiting 3 seconds instead of 1, as we did in !1630, helped a lot:
tails/tails#20354 used to happen "often", now it's quite rare. But it still
happens: I've seen "3.766% of the free memory still has the pattern, but less
than 0.800% was expected".

In
https://gitlab.tails.boum.org/tails/tails/-/merge_requests/1630#note_240453
@anonym wrote:

> 10 sounds a bit much from a "what latency we call good enough for this
> feature" perspective, not from a "minimizing test suite failures" one. I think
> your original 3 is worth trying.

So let's try to find a middle ground.

Note that as opposed to !1630, which bumped the sleep time from 1s to 3s for all
the memory erasure scenarios, here I'm bumping it only for the specific scenario
where I've seen a recent failure. Interestingly, while tails/tails#20354 does
not say which exact scenarios were found to be affected back then, in the
attached debug.log the only affected one is the scenario that I saw failing
here. So it might be than 1 second worked just fine for all the other scenarios,
and only this one needed a bump. I'm not going to dive into this deeper as
3 seconds seems to be a reasonable baseline.

For more context, see the full discussion around the aforementioned comment.
---
 features/erase_memory.feature | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/features/erase_memory.feature b/features/erase_memory.feature
index 61eb2d6a2a0..5c889256a88 100644
--- a/features/erase_memory.feature
+++ b/features/erase_memory.feature
@@ -16,7 +16,7 @@ Feature: System memory erasure on shutdown
     When I start a process allocating 128 MiB of memory with a known pattern
     Then patterns cover at least 128 MiB in the guest's memory
     When I kill the allocating process
-    Then I find very few patterns in the guest's memory after 3 seconds
+    Then I find very few patterns in the guest's memory after 5 seconds
 
   Scenario: Erasure of tmpfs data on unmount
     Given I have started Tails from DVD without network and logged in
-- 
GitLab