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

[Neo Plugin UT] Add a dbft unit test system #3371

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Jun 29, 2024

Description

DBFT plugin lacks unit test system. Thus having this pr that build a unit test environment for DBFT plugin.

This UT will mock a 7 nodes network.

Problem still exist in this test engine that consensus will still go automatically, we need a manual system where every single nodes operation can be manually controlled and set. But it should be fine since test is not likly run over 15s.

Fixes # #3231

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@@ -38,6 +38,14 @@ public DBFTPlugin()
RemoteNode.MessageReceived += ((IMessageReceivedHandler)this).RemoteNode_MessageReceived_Handler;
}

#if DEBUG
Copy link
Member

Choose a reason for hiding this comment

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

if debug?

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

I understand the test but this is a little different from what we had before.
The AkkaTestkit was used to simulate the calls.

Consensus tests need to be something that we can call the same methods and flow of the consensus, such as Reset, InitializeConsensus, MakePrepare Request,etc...

Maybe your way is even better, but this is not clear to me yet.
So, for now I would prefer to merge in another branch until we extend the tests for at least a simple flow of the consensus. Then, we add other possible scenarios.

@Jim8y
Copy link
Contributor Author

Jim8y commented Jun 30, 2024

I understand the test but this is a little different from what we had before. The AkkaTestkit was used to simulate the calls.

Consensus tests need to be something that we can call the same methods and flow of the consensus, such as Reset, InitializeConsensus, MakePrepare Request,etc...

Maybe your way is even better, but this is not clear to me yet. So, for now I would prefer to merge in another branch until we extend the tests for at least a simple flow of the consensus. Then, we add other possible scenarios.

I will keep updating according to your suggestion, not necessarily be one way, i will also add the method you mentioned.

@vncoelho
Copy link
Member

I understand the test but this is a little different from what we had before. The AkkaTestkit was used to simulate the calls.

Consensus tests need to be something that we can call the same methods and flow of the consensus, such as Reset, InitializeConsensus, MakePrepare Request,etc...

Maybe your way is even better, but this is not clear to me yet. So, for now I would prefer to merge in another branch until we extend the tests for at least a simple flow of the consensus. Then, we add other possible scenarios.

I will keep updating according to your suggestion, not necessarily be one way, i will also add the method you mentioned.

Great, let me know because I am available to help as soon as I understand the way you are designing for calling these methods.

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

Successfully merging this pull request may close these issues.

4 participants