Skip to content

Fix Multi-Nodes tests + Clean unwinding process - #37

Open
CryptoPascal31 wants to merge 10 commits into
masterfrom
multinodes_tests
Open

Fix Multi-Nodes tests + Clean unwinding process#37
CryptoPascal31 wants to merge 10 commits into
masterfrom
multinodes_tests

Conversation

@CryptoPascal31

@CryptoPascal31 CryptoPascal31 commented Aug 25, 2026

Copy link
Copy Markdown
Member

The objective of this PR is to make Multi Nodes tests 100% reliable.

Sanitizing the node itself:

  • Better control on the CutDB stop process. The PQueue was modified to manage an optional EOF flag. As such, CutDB pipeline is now always stopped by the Pqueue in a safe and known position. Avoiding risks of stopping in the middle of processing, leading it to an undetermined state.

  • Miner resources (Mining coordinator). No clean mechanism was intended to unwind it naturally. Only an AsyncException could stop it. This was improved by replacing runConcurently by withAsync.

Sanitizing the test routines:

  • MOST IMPORTANT POINT: When running nodes for seconds, Timeout is applied on the inner function only not on the whole node. Letting the node to "unwind its resources by itself" in a safe order avoiding instabilities an dependencies issues.

  • There was a bug during multi-node "replay only"... Except the first node, all nodes were awaiting on the bootstrapPortVar MVar.. This was not the expected behavior. This bugs was silent because the "replay only" was only tested on the first node, and then everything cancelled.

  • When taking snapshot if the current Cut state, we stop the CutDb early. This make the test then 100% reliable, and addresses the "Flaky concern" (see old comments).

Note:

  • Pqueue throws an AsyncCancelled exception and it detects a EOF flag. From an architecture point of view, this not the clean way to do it…
    But this has the advantage of keeping things simple, and then being handled correctly by runForever util function, which excpect an AysncException to not restart automatically the loop.

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