Skip to content

Commit 15e54aa

Browse files
committed
Fix timing race condition in locales_to_js_spec.rb
- Replace timing comparison with direct file modification time check - Test now verifies that up-to-date files are not modified - Eliminates microsecond-level timing race condition
1 parent 164e8d1 commit 15e54aa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

spec/react_on_rails/locales_to_js_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ module ReactOnRails
4949
ref_time = Time.current - 1.minute
5050
FileUtils.touch(translations_path, mtime: ref_time)
5151

52-
update_time = Time.current
5352
described_class.new
54-
expect(update_time).to be > File.mtime(translations_path)
53+
expect(File.mtime(translations_path)).to eq(ref_time)
5554
end
5655
end
5756
end

0 commit comments

Comments
 (0)