Create a browser node test that syncs with a local development node #6467
Description
At the moment, the browser node is a pain to maintain, and breaks frequently (#6457 etc). As we can't test the browser node fully without syncing with another node, and as syncing with flaming fir or another permanent testnet is unreliable, we need a test that tries to sync the browser node with a temporary dev node that's spun up in CI.
Here is a rough idea of how it would work:
- A
--dev
node is started up with--listen-addr /ip4/0.0.0.0/tcp/30334/ws
. - The dev node's peer id is fetched.
- A headless browser test is started, with the peer id as an argument.
- We test to see if the test syncs a few blocks within a certain time frame (i.e. 1 minute).
Here is a branch that I've started writing this on: https://github.com/paritytech/substrate/tree/ashley-browser-sync-test (based on #6457).
Unfortunately, when I run a node with cargo run -- --dev --validator --listen-addr /ip4/0.0.0.0/tcp/30333 --listen-addr /ip4/0.0.0.0/tcp/30334/ws
, the browser node keeps connecting and disconnecting: https://gist.github.com/expenses/212d7c4d9e82c893ace412c99f4764f4, so we need to sort that out first.