bosagora / agora

POC Node implementation for CoinNet
https://bosagora.io
MIT License
37 stars 22 forks source link

Simplify quorum tests #1264

Open AndrejMitrovic opened 3 years ago

AndrejMitrovic commented 3 years ago

Currently the quorum tests such as these ones are testing exact quorum layouts after every shuffle. But this makes the tests very brittle to any changes in Agora.

We want to test:

For the second point we don't have to test the exact layout, just that it has changed compared to the previous state.

AndrejMitrovic commented 3 years ago

For the first point we should collect the quorum configs of all nodes at a given height, and then call these two functions: https://github.com/bpfkorea/agora/blob/b56e22526f4c6f74f609035fbb2490599f57e8a2/source/agora/consensus/Quorum.d#L130-L131

hewison-chris commented 3 years ago

Currently I am refactoring the QuorumShuffle test and I see that it is generating the quorum configs from the production code and then checking that they are changing at the correct interval. I think the issue of hardcoded checks is more related to the QuorumPreimage test where the quorums have been recorded at some point in time and then are checked against.