Francois Gouget : testbot/Janitor: Avoid false positives when cleaning up staging.

Alexandre Julliard julliard at winehq.org
Wed Feb 12 16:13:58 CST 2020


Module: tools
Branch: master
Commit: 9d6a892b99a8757ccc8118bcfa4d782e5f1f4264
URL:    https://source.winehq.org/git/tools.git/?a=commit;h=9d6a892b99a8757ccc8118bcfa4d782e5f1f4264

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Wed Feb 12 16:02:00 2020 +0100

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

Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 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 0635b37..8d50349 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";




More information about the wine-cvs mailing list