1
0

12 Commits

Author SHA1 Message Date
f321x
a6a57f0fec tests: add unittest for Abstract_Wallet.export_history_to_file
Adds unittest for Abstract_Wallet.export_history_to_file that
compares the output against reference files. This
should help to prevent regressions and ensure the layout
of the export stays static over time.
2026-02-03 18:01:14 +01:00
SomberNight
0afd433c42 tests: properly clean-up MockLNWallets after tests finish 2026-01-05 15:56:10 +00:00
SomberNight
dbacb503a4 tests: fix DeprecationWarnings for py3.14: asyncio.iscoroutinefunction
same as https://github.com/spesmilo/electrum/pull/10197
2025-10-09 15:43:54 +00:00
SomberNight
5d1df96020 tests: clear util.callback_mgr between test cases
util.callback_mgr.callbacks was not getting properly cleared between tests.
Every time an Abstract_Wallet or an LNWorker (or many other subclasses of EventListener) is instantiated,
self.register_callbacks() is called in __init__, which puts callbacks into util.callback_mgr.callbacks.
These are only cleaned up if we explicitly call Abstract_Wallet.stop() or LNWorker.stop() later, which we usually do not do in the tests.

As a result, when running multiple unit tests in a row, lots of objects created in a given testcase are never GC-ed and leak into subsequent tests. This is not only a memory leak, but wastes compute too: when events are triggered and cbs get called, these old objects also have their cbs called.

After running all (~1061) unit tests, I observe util.callback_mgr.callbacks had 30 events with a total of 3156 callbacks stored.

On my laptop, running all unit tests previously took ~115 sec, and now it takes ~73 sec.
2025-09-26 15:53:41 +00:00
ghost43
186b8ec2ab Merge pull request #10111 from SomberNight/202508_iface_cache_broadcast_tx
interface: don't request same tx from server that we just broadcast to it
2025-08-08 17:28:34 +00:00
SomberNight
4f1cc8b9cb tests: set low wallet.gap_limit_for_change to speed up tests 2025-08-08 16:36:39 +00:00
SomberNight
cd8bbcd2bb tests: don't block forever if a prior unit test raised during setUp 2025-08-08 14:35:00 +00:00
SomberNight
8efc2aab5e tests: interface: implement toy electrum server 2025-08-08 14:33:38 +00:00
SomberNight
09e412baf8 tests: enable verbose stderr logging
note: print() statements and stderr logging don't have a consistent printing order.
Either can buffer log lines and flush them later, and the buffers are independent.
2025-06-09 17:40:27 +00:00
bitromortac
de9fee706d unit tests: tests for both anchors and old ctx types
* in test_lnutil, patch htlc weight to pass original anchor commitment
  test vectors
* activate tests for both commitment types
2024-11-25 12:31:38 +01:00
SomberNight
1257f21b1b constants: rm set_testnet/set_mainnet fns with AbstractNet.set_as_network 2024-09-16 15:27:45 +00:00
Sander van Grieken
73fee69f5c tests: move /electrum/tests to /tests 2024-02-16 15:40:45 +01:00