Skip to content

Instantly share code, notes, and snippets.

@alexzaitsev
Last active December 18, 2023 23:46
Show Gist options
  • Save alexzaitsev/01f5f1d534651cafa2484a5f333632a5 to your computer and use it in GitHub Desktop.
Save alexzaitsev/01f5f1d534651cafa2484a5f333632a5 to your computer and use it in GitHub Desktop.
Alex-Zaitsev-answer

Successful tests

p3ngu1n@p3ngu1n bitcoin % python3 test/functional/feature_fee_estimation.py
2023-12-18T23:37:21.120000Z TestFramework (INFO): PRNG seed is: 1889367143121386098
2023-12-18T23:37:21.120000Z TestFramework (INFO): Initializing test directory /var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_srkyz249
2023-12-18T23:37:21.139000Z TestFramework (INFO): This test is time consuming, please be patient
2023-12-18T23:37:21.139000Z TestFramework (INFO): Splitting inputs so we can generate tx's
2023-12-18T23:37:21.751000Z TestFramework (INFO): Finished splitting
2023-12-18T23:37:22.516000Z TestFramework (INFO): Testing estimates with single transactions.
2023-12-18T23:37:22.516000Z TestFramework (INFO): Will output estimates for 1/2/3/6/15/25 blocks
2023-12-18T23:37:22.516000Z TestFramework (INFO): Creating transactions and mining them with a block size that can't keep up
2023-12-18T23:37:29.437000Z TestFramework (INFO): Creating transactions and mining them at a block size that is just big enough
2023-12-18T23:37:39.137000Z TestFramework (INFO): Creating transactions and mining them with a block size that can't keep up
2023-12-18T23:37:53.125000Z TestFramework (INFO): Creating transactions and mining them at a block size that is just big enough
2023-12-18T23:38:07.188000Z TestFramework (INFO): Final estimates after emptying mempools
2023-12-18T23:38:07.308000Z TestFramework (INFO): Test fee_estimates.dat is flushed periodically
2023-12-18T23:38:08.615000Z TestFramework (INFO): Test fee rate estimation after restarting node with high MempoolMinFee
2023-12-18T23:38:10.073000Z TestFramework (INFO): Test acceptstalefeeestimates option
2023-12-18T23:38:10.567000Z TestFramework (INFO): Test reading old fee_estimates.dat
2023-12-18T23:38:11.425000Z TestFramework (INFO): Restarting node with fresh estimation
2023-12-18T23:38:11.990000Z TestFramework (INFO): Testing estimates with RBF.
2023-12-18T23:38:33.284000Z TestFramework (INFO): Testing that fee estimation is disabled in blocksonly.
2023-12-18T23:38:33.765000Z TestFramework (INFO): Stopping nodes
2023-12-18T23:38:33.933000Z TestFramework (INFO): Cleaning up /var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_srkyz249 on exit
2023-12-18T23:38:33.933000Z TestFramework (INFO): Tests successful
p3ngu1n@p3ngu1n bitcoin % 

Changes

p3ngu1n@p3ngu1n bitcoin % git show 09e654d06d17cbbb8eb0e114cb536c0055a34d80
commit 09e654d06d17cbbb8eb0e114cb536c0055a34d80 (HEAD)
Author: Alex Zaitsev <alex.zaitsev.pro@gmail.com>
Date:   Mon Dec 18 16:41:52 2023 -0700

    test

diff --git a/test/functional/feature_fee_estimation.py b/test/functional/feature_fee_estimation.py
index 4f56d585d3..9f2c6edb2d 100755
--- a/test/functional/feature_fee_estimation.py
+++ b/test/functional/feature_fee_estimation.py
@@ -78,7 +78,7 @@ def check_raw_estimates(node, fees_seen):
     for i in range(1, 26):
         for _, e in node.estimaterawfee(i).items():
             feerate = float(e["feerate"])
-            assert_greater_than(feerate, 0)
+            assert_equal(feerate, 0)
 
             if feerate + delta < min(fees_seen) or feerate - delta > max(fees_seen):
                 raise AssertionError(
p3ngu1n@p3ngu1n bitcoin % 

Failed test

p3ngu1n@p3ngu1n bitcoin % python3 test/functional/feature_fee_estimation.py
2023-12-18T23:42:37.700000Z TestFramework (INFO): PRNG seed is: 5368588013231051346
2023-12-18T23:42:37.700000Z TestFramework (INFO): Initializing test directory /var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_94r32ka0
2023-12-18T23:42:37.718000Z TestFramework (INFO): This test is time consuming, please be patient
2023-12-18T23:42:37.718000Z TestFramework (INFO): Splitting inputs so we can generate tx's
2023-12-18T23:42:38.327000Z TestFramework (INFO): Finished splitting
2023-12-18T23:42:39.050000Z TestFramework (INFO): Testing estimates with single transactions.
2023-12-18T23:42:39.050000Z TestFramework (INFO): Will output estimates for 1/2/3/6/15/25 blocks
2023-12-18T23:42:39.050000Z TestFramework (INFO): Creating transactions and mining them with a block size that can't keep up
2023-12-18T23:42:45.316000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/test_framework/test_framework.py", line 131, in main
    self.run_test()
  File "/Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/feature_fee_estimation.py", line 405, in run_test
    self.sanity_check_estimates_range()
  File "/Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/feature_fee_estimation.py", line 214, in sanity_check_estimates_range
    check_estimates(self.nodes[1], self.fees_per_kb)
  File "/Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/feature_fee_estimation.py", line 120, in check_estimates
    check_raw_estimates(node, fees_seen)
  File "/Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/feature_fee_estimation.py", line 81, in check_raw_estimates
    assert_equal(feerate, 0)
  File "/Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/test_framework/util.py", line 57, in assert_equal
    raise AssertionError("not(%s)" % " == ".join(str(arg) for arg in (thing1, thing2) + args))
AssertionError: not(0.00153904 == 0)
2023-12-18T23:42:45.372000Z TestFramework (INFO): Stopping nodes
2023-12-18T23:42:45.595000Z TestFramework (WARNING): Not cleaning up dir /var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_94r32ka0
2023-12-18T23:42:45.595000Z TestFramework (ERROR): Test failed. Test logging available at /var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_94r32ka0/test_framework.log
2023-12-18T23:42:45.595000Z TestFramework (ERROR): 
2023-12-18T23:42:45.595000Z TestFramework (ERROR): Hint: Call /Users/p3ngu1n/Documents/Develop/bitcoin/test/functional/combine_logs.py '/var/folders/q6/qjgkk7jn6kj_0tyhxx_dlk0m0000gp/T/bitcoin_func_test_94r32ka0' to consolidate all logs
2023-12-18T23:42:45.595000Z TestFramework (ERROR): 
2023-12-18T23:42:45.595000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2023-12-18T23:42:45.595000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues
2023-12-18T23:42:45.595000Z TestFramework (ERROR): 
p3ngu1n@p3ngu1n bitcoin % 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment