aboutsummaryrefslogtreecommitdiff
path: root/reftable/stack_test.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-08 16:06:34 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-08 10:14:42 -0700
commit5f0ed603a1653f2394c468814bde4b0dca2cff45 (patch)
treed29206b98814668e072709f087d283df3f816f62 /reftable/stack_test.c
parent8030100bdafc508eaa7900ebcfd67a2d6b02749e (diff)
downloadgit-5f0ed603a1653f2394c468814bde4b0dca2cff45.tar.xz
reftable/stack: update stats on failed full compaction
When auto-compaction fails due to a locking error, we update the statistics to indicate this failure. We're not doing the same when performing a full compaction. Fix this inconsistency by using `stack_compact_range_stats()`, which handles the stat update for us. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/stack_test.c')
-rw-r--r--reftable/stack_test.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/reftable/stack_test.c b/reftable/stack_test.c
index 1d109933d3..3ed8e44924 100644
--- a/reftable/stack_test.c
+++ b/reftable/stack_test.c
@@ -1005,8 +1005,7 @@ static void test_reftable_stack_compaction_with_locked_tables(void)
*/
err = reftable_stack_compact_all(st, NULL);
EXPECT(err == REFTABLE_LOCK_ERROR);
- /* TODO: this is wrong, we should get notified about the failure. */
- EXPECT(st->stats.failures == 0);
+ EXPECT(st->stats.failures == 1);
EXPECT(st->merged->stack_len == 3);
reftable_stack_destroy(st);