diff --git a/Library/Homebrew/test/test_migrator.rb b/Library/Homebrew/test/test_migrator.rb
index b22184888fac2ee5df16508326c4e780fc4852d6..236c7e00d2fa24597823133d3e15f5228f7127fa 100644
--- a/Library/Homebrew/test/test_migrator.rb
+++ b/Library/Homebrew/test/test_migrator.rb
@@ -93,6 +93,8 @@ class MigratorTests < Homebrew::TestCase
     rmtree HOMEBREW_PREFIX/"opt" if (HOMEBREW_PREFIX/"opt").directory?
     # What to do with pin?
     @new_f.unpin
+
+    FormulaLock::LOCKDIR.children.each(&:unlink)
   end
 
   def test_move_cellar