Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flaky test CliqueMiningAcceptanceTest > shouldStallMiningWhenInsufficientValidators() FAILED #8240

Open
macfarla opened this issue Feb 4, 2025 · 5 comments · May be fixed by #8357
Open
Assignees
Labels
flake 60% of the time it works 100% of the time. testing

Comments

@macfarla
Copy link
Contributor

macfarla commented Feb 4, 2025

https://github.com/hyperledger/besu/actions/runs/13129266357/job/36631186322

CliqueMiningAcceptanceTest > shouldStallMiningWhenInsufficientValidators() FAILED
    org.opentest4j.AssertionFailedError: 
    Expecting value to be false but was true
        at app//org.hyperledger.besu.tests.acceptance.dsl.transaction.eth.EthGetBlockTransaction.execute(EthGetBlockTransaction.java:44)
        at app//org.hyperledger.besu.tests.acceptance.dsl.transaction.eth.EthGetBlockTransaction.execute(EthGetBlockTransaction.java:28)
        at app//org.hyperledger.besu.tests.acceptance.dsl.node.BesuNode.execute(BesuNode.java:819)
        at app//org.hyperledger.besu.tests.acceptance.clique.CliqueMiningAcceptanceTest.startClusterAndVerifyProducingBlocks(CliqueMiningAcceptanceTest.java:130)
        at app//org.hyperledger.besu.tests.acceptance.clique.CliqueMiningAcceptanceTest.shouldStallMiningWhenInsufficientValidators(CliqueMiningAcceptanceTest.java:109)

9 tests completed, 1 failed
@macfarla macfarla added flake 60% of the time it works 100% of the time. testing labels Feb 4, 2025
@macfarla
Copy link
Contributor Author

maybe have a look at the approach done in #8324

@pr9t
Copy link
Contributor

pr9t commented Feb 20, 2025

@macfarla, please assign this to me.

@pr9t pr9t linked a pull request Feb 26, 2025 that will close this issue
9 tasks
@pr9t
Copy link
Contributor

pr9t commented Feb 26, 2025

Hi @macfarla, based on my understanding of the code, the error persists because, even after stopping minerNode2 and minerNode3, they are still listed as validators. Clique continues to recognize these nodes as signers, preventing mining from stalling. This is the approach I am taking to modify my code.

@macfarla
Copy link
Contributor Author

from the stack trace, line 130 is from within startClusterAndVerifyProducingBlocks when we're trying to assert that all 3 nodes have the block number 1 (or whatever block number minderNode1 is up to) - before the test removes 2 and 3 from the validators - and because it's flaky, it doesn't fail every time.

  private void startClusterAndVerifyProducingBlocks(
      final BesuNode minerNode1, final BesuNode minerNode2, final BesuNode minerNode3) {
    cluster.start(minerNode1, minerNode2, minerNode3);
    // verify nodes are fully connected otherwise blocks could not be propagated
    minerNode1.verify(net.awaitPeerCount(2));
    minerNode2.verify(net.awaitPeerCount(2));
    minerNode3.verify(net.awaitPeerCount(2));
    // verify that we have started producing blocks
    waitForBlockHeight(minerNode1, 1);
    final var minerChainHead = minerNode1.execute(ethTransactions.block());
    minerNode2.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue()));
    minerNode3.verify(blockchain.minimumHeight(minerChainHead.getNumber().longValue()));
  }

so I think it needs a different approach to #8324 - if we change the mining tests so that we always have 1 validator I think that it will be testing different functionality

@macfarla
Copy link
Contributor Author

@jframe do you have any input on how to fix this flaky Clique test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flake 60% of the time it works 100% of the time. testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants