From edb647667e5630c77515e99a66bccec9d7519c0e Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 14 Jan 2016 00:41:02 +0900 Subject: [PATCH] Change temporary file names to fix flaky tests --- test/test_go.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/test_go.rb b/test/test_go.rb index 85e3d83..a049a15 100644 --- a/test/test_go.rb +++ b/test/test_go.rb @@ -143,8 +143,10 @@ class TestBase < Minitest::Test attr_reader :tmux def tempname + @temp_suffix ||= 0 [TEMPNAME, - caller_locations.map(&:label).find { |l| l =~ /^test_/ }].join '-' + caller_locations.map(&:label).find { |l| l =~ /^test_/ }, + @temp_suffix].join '-' end def setup @@ -158,6 +160,7 @@ class TestBase < Minitest::Test File.read(tempname) ensure File.unlink tempname while File.exists?(tempname) + @temp_suffix += 1 tmux.prepare end