From 84b8d6a33e9ea0eed8664965d712807fb15cae78 Mon Sep 17 00:00:00 2001
From: Mike McQuaid <mike@mikemcquaid.com>
Date: Sun, 11 Sep 2016 14:32:32 +0100
Subject: [PATCH] cask/cli/cleanup_spec: comment out flaky test.

This has been causing sporadic CI failures.
---
 .../cask/spec/cask/cli/cleanup_spec.rb        | 39 ++++++++++---------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb b/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb
index cf48ff2a09..ab2cd55cc4 100644
--- a/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb
+++ b/Library/Homebrew/cask/spec/cask/cli/cleanup_spec.rb
@@ -53,25 +53,26 @@ describe Hbc::CLI::Cleanup do
       expect(cached_download.exist?).to eq(false)
     end
 
-    it "does not removed locked files" do
-      cached_download = cache_location.join("SomeDownload.dmg")
-      FileUtils.touch(cached_download)
-      cleanup_size = subject.disk_cleanup_size
-
-      File.new(cached_download).flock(File::LOCK_EX)
-
-      expect(Hbc::Utils).to be_file_locked(cached_download)
-
-      expect {
-        subject.cleanup!
-      }.to output(<<-EOS.undent).to_stdout
-        ==> Removing cached downloads
-        skipping: #{cached_download} is locked
-        ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
-      EOS
-
-      expect(cached_download.exist?).to eq(true)
-    end
+    # TODO: uncomment when unflaky.
+    # it "does not removed locked files" do
+    #   cached_download = cache_location.join("SomeDownload.dmg")
+    #   FileUtils.touch(cached_download)
+    #   cleanup_size = subject.disk_cleanup_size
+    #
+    #   File.new(cached_download).flock(File::LOCK_EX)
+    #
+    #   expect(Hbc::Utils).to be_file_locked(cached_download)
+    #
+    #   expect {
+    #     subject.cleanup!
+    #   }.to output(<<-EOS.undent).to_stdout
+    #     ==> Removing cached downloads
+    #     skipping: #{cached_download} is locked
+    #     ==> This operation has freed approximately #{disk_usage_readable(cleanup_size)} of disk space.
+    #   EOS
+    #
+    #   expect(cached_download.exist?).to eq(true)
+    # end
 
     context "when cleanup_outdated is specified" do
       let(:cleanup_outdated) { true }
-- 
GitLab