Skip to content

Test: compare the renamed pre-shutdown snapshot and pin the head - #547

Merged
heifner merged 1 commit into
masterfrom
test/chainbase-allocation-snapshot-compare
Aug 6, 2026
Merged

Test: compare the renamed pre-shutdown snapshot and pin the head#547
heifner merged 1 commit into
masterfrom
test/chainbase-allocation-snapshot-compare

Conversation

@heifner

@heifner heifner commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

nodeop_chainbase_allocation_test failed in the ubsan job of run 31047433131 with FileNotFoundError rather than its own assertion message.

The comparison read the pre-rename path, which no longer exists once the snapshot is moved aside. When both snapshots land on the same head the two names are identical, so filecmp compared the post-restart snapshot with itself and the snapshot is not identical assertion could never fail. When the heads differ the path is gone and the test dies inside filecmp.

The heads differ whenever the irreversible-mode node is still short of the producer's final LIB. Killing the sole producer can leave its last block undelivered, and the fixed three second sleep was not a guarantee that the node had caught up. In the failing run the snapshot landed one block short of the schedule promotion, so global_property_object was not exercised either. The test now waits on the node's own LIB, then takes down the remaining peers so nothing can advance it between the two snapshots.

It also compares with shallow=False so matching stat signatures cannot stand in for a byte comparison, and reports a mismatched head directly instead of letting it surface as a confusing byte difference.

Exercised locally across runs that landed on different heads, which is the variability that broke the previous version.

The comparison read the pre-rename path, which no longer exists once the snapshot is moved aside. When both snapshots land on the same head the two names are identical, so filecmp compared the post-restart snapshot with itself and the assertion could never fail; when the heads differ the path is gone and the test dies with FileNotFoundError instead of its message.

The heads differ whenever the irreversible-mode node is still short of the producer's final LIB. Killing the sole producer can leave its last block undelivered, and the fixed three second sleep was not a guarantee that the node had caught up. Wait on the node's own LIB instead, then take down the remaining peers so nothing can advance it between the two snapshots.

Also compare with shallow=False so matching stat signatures cannot stand in for a byte comparison, and report a mismatched head directly rather than letting it surface as a confusing byte difference.

@huangminghuang huangminghuang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 367da66. No actionable findings.

@heifner
heifner merged commit 2b74bed into master Aug 6, 2026
13 checks passed
@heifner
heifner deleted the test/chainbase-allocation-snapshot-compare branch August 6, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants