Merge branch 'master' into jsdw-sharding-gatekeeper

This commit is contained in:
James Wilson
2021-08-13 11:16:47 +01:00
3 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -146,4 +146,4 @@ jobs:
working-directory: backend
- name: Cargo test
run: cargo test --verbose --jobs 1 --features e2e 'e2e'
run: cargo test --verbose --jobs 1 e2e -- --ignored
-4
View File
@@ -5,10 +5,6 @@ authors = ["Parity Technologies Ltd. <admin@parity.io>"]
edition = "2018"
license = "GPL-3.0"
[features]
# Run e2e tests by enabling this:
e2e = []
[dependencies]
anyhow = "1.0.41"
bimap = "0.6.1"
+12 -2
View File
@@ -13,7 +13,6 @@
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#![cfg(feature = "e2e")]
/*!
General end-to-end tests
@@ -33,7 +32,7 @@ sudo sysctl -w kern.ipc.maxsockbuf=16777216
These tests can be run with:
```sh
cargo test --features e2e 'e2e'
cargo test e2e -- --ignored
```
*/
@@ -49,6 +48,7 @@ use test_utils::{
/// The simplest test we can run; the main benefit of this test (since we check similar)
/// below) is just to give a feel for _how_ we can test basic feed related things.
#[ignore]
#[tokio::test]
async fn e2e_feed_sent_version_on_connect() {
let server = start_server_debug().await;
@@ -70,6 +70,7 @@ async fn e2e_feed_sent_version_on_connect() {
/// Another very simple test: pings from feeds should be responded to by pongs
/// with the same message content.
#[ignore]
#[tokio::test]
async fn e2e_feed_ping_responded_to_with_pong() {
let server = start_server_debug().await;
@@ -95,6 +96,7 @@ async fn e2e_feed_ping_responded_to_with_pong() {
/// As a prelude to `lots_of_mute_messages_dont_cause_a_deadlock`, we can check that
/// a lot of nodes can simultaneously subscribe and are all sent the expected response.
#[ignore]
#[tokio::test]
async fn e2e_multiple_feeds_sent_version_on_connect() {
let server = start_server_debug().await;
@@ -133,6 +135,7 @@ async fn e2e_multiple_feeds_sent_version_on_connect() {
/// where the shard is waiting trying to send the next "add node" message, while the
/// telemetry core is waiting trying to send up to the shard the next "mute node" message,
/// resulting in a deadlock. This test gives confidence that we don't run into such a deadlock.
#[ignore]
#[tokio::test]
async fn e2e_lots_of_mute_messages_dont_cause_a_deadlock() {
let mut server = start_server_debug().await;
@@ -189,6 +192,7 @@ async fn e2e_lots_of_mute_messages_dont_cause_a_deadlock() {
/// If a node is added, a connecting feed should be told about the new chain.
/// If the node is removed, the feed should be told that the chain has gone.
#[ignore]
#[tokio::test]
async fn e2e_feed_add_and_remove_node() {
// Connect server and add shard
@@ -253,6 +257,7 @@ async fn e2e_feed_add_and_remove_node() {
/// If nodes connect and the chain name changes, feeds will be told about this
/// and will keep receiving messages about the renamed chain (despite subscribing
/// to it by name).
#[ignore]
#[tokio::test]
async fn e2e_feeds_told_about_chain_rename_and_stay_subscribed() {
// Connect a node:
@@ -345,6 +350,7 @@ async fn e2e_feeds_told_about_chain_rename_and_stay_subscribed() {
/// If we add a couple of shards and a node for each, all feeds should be
/// told about both node chains. If one shard goes away, we should get a
/// "removed chain" message only for the node connected to that shard.
#[ignore]
#[tokio::test]
async fn e2e_feed_add_and_remove_shard() {
let mut server = start_server_debug().await;
@@ -421,6 +427,7 @@ async fn e2e_feed_add_and_remove_shard() {
/// feeds can subscribe to one chain at a time. They should get the relevant
/// messages for that chain and no other.
#[ignore]
#[tokio::test]
async fn e2e_feed_can_subscribe_and_unsubscribe_from_chain() {
use FeedMessage::*;
@@ -529,6 +536,7 @@ async fn e2e_feed_can_subscribe_and_unsubscribe_from_chain() {
}
/// If a node sends more than some rolling average amount of data, it'll be booted.
#[ignore]
#[tokio::test]
async fn e2e_node_banned_if_it_sends_too_much_data() {
async fn try_send_data(max_bytes: usize, send_msgs: usize, bytes_per_msg: usize) -> bool {
@@ -580,6 +588,7 @@ async fn e2e_node_banned_if_it_sends_too_much_data() {
}
/// Feeds will be disconnected if they can't receive messages quickly enough.
#[ignore]
#[tokio::test]
async fn e2e_slow_feeds_are_disconnected() {
let mut server = start_server(
@@ -677,6 +686,7 @@ async fn e2e_slow_feeds_are_disconnected() {
/// If something connects to the `/submit` endpoint, there is a limit to the number
/// of different messags IDs it can send telemetry about, to prevent a malicious actor from
/// spamming a load of message IDs and exhausting our memory.
#[ignore]
#[tokio::test]
async fn e2e_max_nodes_per_connection_is_enforced() {
let mut server = start_server(