Seen in #13's CI (valgrind shard). Upstream test, unchanged by this repo, and identical on upstream master.
What happens
test_tracing starts and stops a node, then replays its trace file. At the end it expects every span still open to be a suspended one:
# We can actually have a calls suspended when we shut down!
assert len(suspended) <= 1
assert suspended == traces
It failed with assert {'e8b643d97292f57b'} == {'71725f51804ebb5d', 'e8b643d97292f57b'}. The trace file ended with:
span_start 71725f51804ebb5d extend_tip
span_start e8b643d97292f57b plugin/bitcoind
span_suspend e8b643d97292f57b
The node stopped while extend_tip (lightningd/chaintopology.c) was waiting on a plugin/bitcoind call. The child is suspended, but its parent extend_tip span is open and not suspended, so the set comparison fails. Under valgrind the bitcoind round trip is long enough for shutdown to land inside it.
Why defer
Timing only, in upstream code this repo does not change. A rerun passes.
Fix options
The trace file does not record a span's parent until span_emit, so the test cannot tell an open parent from a leaked span. Either record the parent in span_start, or relax the check to allow open spans that were started before the suspended one and not ended. The first is the stronger check.
Seen in #13's CI (valgrind shard). Upstream test, unchanged by this repo, and identical on upstream master.
What happens
test_tracingstarts and stops a node, then replays its trace file. At the end it expects every span still open to be a suspended one:It failed with
assert {'e8b643d97292f57b'} == {'71725f51804ebb5d', 'e8b643d97292f57b'}. The trace file ended with:The node stopped while
extend_tip(lightningd/chaintopology.c) was waiting on aplugin/bitcoindcall. The child is suspended, but its parentextend_tipspan is open and not suspended, so the set comparison fails. Under valgrind the bitcoind round trip is long enough for shutdown to land inside it.Why defer
Timing only, in upstream code this repo does not change. A rerun passes.
Fix options
The trace file does not record a span's parent until
span_emit, so the test cannot tell an open parent from a leaked span. Either record the parent inspan_start, or relax the check to allow open spans that were started before the suspended one and not ended. The first is the stronger check.