From 9ecd690c9280dc58495e3ac0e626da1a94a4d32f Mon Sep 17 00:00:00 2001 From: theohax Date: Mon, 24 Jan 2022 17:52:28 +0200 Subject: [PATCH] Add docs/comments explaining unit tests --- nano/core_test/node.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nano/core_test/node.cpp b/nano/core_test/node.cpp index 9952ebfecf..ba2a427d44 100644 --- a/nano/core_test/node.cpp +++ b/nano/core_test/node.cpp @@ -4301,6 +4301,8 @@ TEST (rep_crawler, local) } } +// Test that a node configured with `enable_pruning` and `max_pruning_age = 1s` will automatically +// prune old confirmed blocks without explicitly saying `node.ledger_pruning` in the unit test TEST (node, pruning_automatic) { nano::system system{}; @@ -4355,10 +4357,7 @@ TEST (node, pruning_automatic) ASSERT_TRUE (node1.ledger.block_or_pruned_exists (send2->hash ())); } -// Test disabled because it's failing intermittently. -// PR in which it got disabled: https://github.com/nanocurrency/nano-node/pull/3629 -// Issue for investigating it: https://github.com/nanocurrency/nano-node/issues/3641 -TEST (node, DISABLED_pruning_age) +TEST (node, pruning_age) { nano::system system{}; @@ -4419,6 +4418,8 @@ TEST (node, DISABLED_pruning_age) ASSERT_TRUE (node1.ledger.block_or_pruned_exists (send2->hash ())); } +// Test that a node configured with `enable_pruning` will +// prune DEEP-enough confirmed blocks by explicitly saying `node.ledger_pruning` in the unit test TEST (node, pruning_depth) { nano::system system{};