hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
438 stars 280 forks source link

Restore `unstable_tests` #5164

Open mversic opened 1 week ago

mversic commented 1 week ago

These are some of the most important tests. They were removed in #5124

0x009922 commented 3 days ago

It's rather that this issue is a duplicate of #5153, which pointed out to specific tests to re-implement. Namely, unstable_network.

To give more context: those tests were creating a network of many peers and submitting many transactions. During each round they "froze" some amount of random peers in the network, making them "faulty". The mechanism of "freezing" was working via a direct violation of black-boxing (using an internal flag to stop networking temporarily), thus I removed it.

As an alternative idea of how to re-implement these tests without breaking black-boxing: we can set up a network of peers in which they communicate with each other not directly, but via a relay (which we control). That relay would listen to $N * N$ ports (where $N$ is the number of peers in the network), so that each peer will have its own subset of ports in the relay for all other peers. When we want to make some peers faulty, we temporarily suspend their incoming/outgoing TCP packages in the proxy.