From cea3338e388f4091f7cfdb70427ab7549fab5e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Wed, 31 Jul 2019 11:15:22 +0300 Subject: [PATCH] tests/mutation_source_tests: generate_mutation_sets() use larger ttl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently all cells generated by this method uses a ttl of 1. This causes test flakyness as tests often compact the input and output mutations to weed out artificial differences between them. If this compaction is not done with the exact same query time, then some cells will be expired in one compaction but not in the other. 733c68cb1 attempted to solve this by passing the same query time to `flat_mutation_reader_assertions::produce_compacted()` as well as `mutation_partition::compact_for_query()` when compacting the input mutation. However a hidden compaction spot remained: the ka/la sstable writer also does some compaction, and for this it uses the time point passed to the `sstable` constructor, which defaults to `gc_clock::now()`. This leads to false positive failures in `sstable_mutation_test.cc`. At this point I don't know what the original intent was behind this low `ttl` value. To solve the immediate problem of the tests failing, I increased it. If it turns out that this `ttl` value has a good reason, we can do a more involved fix, of making sure all sstables written also get the same query time as that used for the compaction. Fixes: #4747 Signed-off-by: Botond Dénes Message-Id: <20190731081522.22915-1-bdenes@scylladb.com> --- tests/mutation_source_test.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mutation_source_test.cc b/tests/mutation_source_test.cc index 4395e2af23..5047cc8d05 100644 --- a/tests/mutation_source_test.cc +++ b/tests/mutation_source_test.cc @@ -1482,7 +1482,7 @@ static mutation_sets generate_mutation_sets() { clustering_key ck1 = clustering_key::from_deeply_exploded(*s1, {data_value(bytes("ck1_0")), data_value(bytes("ck1_1"))}); clustering_key ck2 = clustering_key::from_deeply_exploded(*s1, {data_value(bytes("ck2_0")), data_value(bytes("ck2_1"))}); - auto ttl = gc_clock::duration(1); + auto ttl = gc_clock::duration(1000); { auto tomb = new_tombstone();