diff --git a/lib/bootsnap/load_path_cache/store.rb b/lib/bootsnap/load_path_cache/store.rb index 4e0c2a91..5f5e9fa2 100644 --- a/lib/bootsnap/load_path_cache/store.rb +++ b/lib/bootsnap/load_path_cache/store.rb @@ -91,6 +91,7 @@ def dump_data FileUtils.mv(tmp, @store_path) rescue Errno::EEXIST retry + rescue SystemCallError end end end diff --git a/test/load_path_cache/store_test.rb b/test/load_path_cache/store_test.rb index b70792d0..74e23544 100644 --- a/test/load_path_cache/store_test.rb +++ b/test/load_path_cache/store_test.rb @@ -74,6 +74,12 @@ def test_retry_on_collision store.transaction { store.set('a', 1) } end + + def test_ignore_read_only_filesystem + MessagePack.expects(:dump).raises(Errno::EROFS.new("Read-only file system @ rb_sysopen")) + store.transaction { store.set('a', 1) } + refute(File.exist?(@path)) + end end end end