Skip to content

pytest: test_tracing fails when shutdown lands inside extend_tip's bitcoind call #18

Description

@kwsantiago

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions