[tools] testbot/Janitor: Avoid false positives when cleaning up staging.

Francois Gouget fgouget at codeweavers.com
Wed Feb 12 09:02:00 CST 2020


Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
 testbot/bin/Janitor.pl | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/testbot/bin/Janitor.pl b/testbot/bin/Janitor.pl
index 0635b37880..8d50349c3d 100755
--- a/testbot/bin/Janitor.pl
+++ b/testbot/bin/Janitor.pl
@@ -273,10 +273,23 @@ if (opendir(my $dh, "$DataDir/staging"))
 
     if ($Entry =~ /^[0-9a-f]{32}-websubmit2?_/)
     {
-      # These files always expire after one day
+      # We get these files whenever a developer abandons a job submission.
+      # So just delete them silently after a day.
       $TTL = 1 - $Age;
     }
-    elsif ($Entry !~ /^[0-9a-f]{32}_(?:patch\.diff|patchset\.diff|email|winetest(?:64)?-latest\.exe|work)$/)
+    elsif ($Entry =~ /^[0-9a-f]{32}_(?:patch\.diff|patchset\.diff|email|winetest(?:64)?-latest\.exe|work)$/)
+    {
+      # Janitor can only see these files if it ran during the brief interval
+      # between their creation and them being moved out of staging, or if
+      # something prevented the latter (power loss, bug, etc). So only complain
+      # after a day to avoid false positives.
+      if ($TTL >= 1)
+      {
+        my $Deletion = defined $TTL ? " (deletion in $TTL days)" : "";
+        Error "Found an old transient file$Deletion: staging/$Entry\n"
+      }
+    }
+    else
     {
       my $Deletion = defined $TTL ? " (deletion in $TTL days)" : "";
       Error "Found a suspicious file$Deletion: staging/$Entry\n";
-- 
2.20.1




More information about the wine-devel mailing list