ChainSafe / ChainSafe/gossamer
implement polkadot-sdk integration tests
- Dominant language
- Go
- Stars
- 454
- Forks
- 144
- PR merge metrics
- No merged PRs in 30d
Description
## Issue summary
**List out all the important tests to be added**
The purpose of writing black box tests is to be able to figure out if a subsystem is working as expected without understanding it thoroughly. Anyone who wants to check if a subsystem works well, just needs to know what kind of messages this subsystem is supposed to receive and how should it respond to them.
So, we will mock the behavior of overseer.
We are going to test the behaviour of a subsystem checking how it reacts on receive a particular message from overseer.
In particular for Collator Protocol, send following messages to overseer and see if it send appropriate messages back to overseer
- collatorprotocolmessages.CollateOn,
- collatorprotocolmessages.DistributeCollation,
- collatorprotocolmessages.ReportCollator,
- collatorprotocolmessages.Backed,
- collatorprotocolmessages.Invalid,
- collatorprotocolmessages.Seconded
## List of tests that we could add
- [ ] On receiving an advertisement (considering that it is relevant to us) act on it and send a collation request
- [ ] Test that other subsystems are able to modify a collators' reputation based on its behaviour
- [ ] Test that Signatures are getting verified on `Declare` and `AdvertiseCollation` messages
Tests about collation fetching
- [ ] Test that validator fetches only one collation at any moment of time per relay parent and ignores other advertisements once a candidate gets seconded
- [ ] Test that a validator starts fetching next queued collations on a timeout and in case of an error
- [ ] Test that we can fetch a second collation after first checked collation was found to be invalid
Tests for some networking
- [ ] Disconnect if a peer doesnt send any Declare message
- [ ] Disconnect inactive peers
- [ ] Disconnect if wrong Declare message
- [ ] Clear old collators on a view change
## Other information and links
- https://github.com/paritytech/polkadot-sdk/blob/c679ed79a1de575d4c3d5b8878b3e401b024f2f2/polkadot/node/network/collator-protocol/src/validator_side/tests/mod.rs
Contributor guide
Assessment
This issue has not been assessed yet.