Skip to content

Commit a8c5591

Browse files
committed
test: fix flaky schema dump test to prefer YAML to Marshal
Testing against upstream sqlite3 which returns frozen strings demonstrates that Rails can't guarantee that the schema dumps will be byte-for-byte reproducible when they're in Marshal format.
1 parent 1428ef9 commit a8c5591

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/test/cases/connection_adapters/schema_cache_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,12 +302,12 @@ def test_gzip_dumps_identical
302302
# Create an empty cache.
303303
cache = new_bound_reflection
304304

305-
tempfile_a = Tempfile.new(["schema_cache-", ".dump.gz"])
305+
tempfile_a = Tempfile.new(["schema_cache-", ".yml.gz"])
306306
# Dump it. It should get populated before dumping.
307307
cache.dump_to(tempfile_a.path)
308308
digest_a = Digest::MD5.file(tempfile_a).hexdigest
309309
sleep(1) # ensure timestamp changes
310-
tempfile_b = Tempfile.new(["schema_cache-", ".dump.gz"])
310+
tempfile_b = Tempfile.new(["schema_cache-", ".yml.gz"])
311311
# Dump it. It should get populated before dumping.
312312
cache.dump_to(tempfile_b.path)
313313
digest_b = Digest::MD5.file(tempfile_b).hexdigest

0 commit comments

Comments
 (0)