Skip to content

Commit

Permalink
feat: try opening the file without a lock to see if that's what's cau…
Browse files Browse the repository at this point in the history
…sing problem on windows
  • Loading branch information
bethesque committed Feb 22, 2018
1 parent b05528f commit 0352de0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion spec/mock_service_with_merge_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def logger.debug *args; end
end

let(:mock_service_options) do
{ cli_args: ['--pact-file-write-mode', 'merge'] }
{ cli_args: ['--pact-file-write-mode', 'merge', '--monkeypatch', File.absolute_path('spec/support/monkeypatch.rb')] }
end

let(:first_interaction) do
Expand Down
6 changes: 6 additions & 0 deletions spec/support/monkeypatch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def Filelock(lockname, options = {}, &block)
puts "Opening file without filelock"
File.open(lockname, File::RDWR|File::CREAT, 0644) do |file|
Timeout::timeout(options.fetch(:timeout, 60), Filelock::ExecTimeout) { yield file }
end
end

0 comments on commit 0352de0

Please sign in to comment.