revisit launcher
This commit is contained in:
parent
c11cb74515
commit
957c57aa34
|
@ -15,7 +15,6 @@ jobs:
|
|||
toolchain:
|
||||
- x86_64-unknown-linux-gnu
|
||||
version:
|
||||
- stable
|
||||
- nightly
|
||||
include:
|
||||
- toolchain: x86_64-unknown-linux-gnu
|
||||
|
|
|
@ -4,4 +4,8 @@ members = [
|
|||
"artillery-ddata",
|
||||
"artillery-core",
|
||||
"artillery-hierman",
|
||||
]
|
||||
]
|
||||
|
||||
[profile.release]
|
||||
lto = "fat"
|
||||
codegen-units = 1
|
|
@ -24,7 +24,7 @@ libp2p = "0.16.0"
|
|||
bastion-executor = "0.3.4"
|
||||
lightproc = "0.3.4"
|
||||
crossbeam-channel = "0.4.2"
|
||||
fail = "0.3"
|
||||
kaos = { path = "../../kaos" }
|
||||
|
||||
[dev-dependencies]
|
||||
bincode = "1.2.1"
|
||||
|
@ -32,10 +32,8 @@ clap = "2.33.0"
|
|||
pretty_env_logger = "0.4.0"
|
||||
once_cell = "1.3.1"
|
||||
criterion = "0.3.1"
|
||||
kaos = "0.1"
|
||||
bastion = "0.3"
|
||||
|
||||
# kaos = { path = "../../kaos" }
|
||||
|
||||
[[test]]
|
||||
name = "kaos"
|
||||
name = "chaos_tests"
|
||||
path = "kaos-tests/launcher.rs"
|
|
@ -1,11 +1,10 @@
|
|||
#[macro_export]
|
||||
macro_rules! cluster_init {
|
||||
() => {
|
||||
use bastion::prelude::*;
|
||||
use fail::FailScenario;
|
||||
use std::sync::Once;
|
||||
|
||||
//
|
||||
use kaos::*;
|
||||
|
||||
use std::net::ToSocketAddrs;
|
||||
|
||||
|
@ -131,27 +130,26 @@ macro_rules! node_spawn {
|
|||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! chaos_unleash {
|
||||
($fp_name:expr) => {
|
||||
LOGGER_INIT.call_once(|| pretty_env_logger::init());
|
||||
let scenario = FailScenario::setup();
|
||||
fail::cfg($fp_name, "panic").unwrap();
|
||||
// #[macro_export]
|
||||
// macro_rules! chaos_unleash {
|
||||
// ($fp_name:expr) => {
|
||||
// LOGGER_INIT.call_once(|| pretty_env_logger::init());
|
||||
// let scenario = FailScenario::setup();
|
||||
|
||||
// Let's see how reliable you are.
|
||||
node_spawn!(node1);
|
||||
node_spawn!(node2);
|
||||
node_spawn!(node3);
|
||||
// // Let's see how reliable you are.
|
||||
// node_spawn!(node1);
|
||||
// node_spawn!(node2);
|
||||
// node_spawn!(node3);
|
||||
|
||||
run(
|
||||
async {
|
||||
future::join_all(
|
||||
vec![node1, node2, node3]
|
||||
).await
|
||||
},
|
||||
ProcStack::default(),
|
||||
);
|
||||
// run(
|
||||
// async {
|
||||
// future::join_all(
|
||||
// vec![node1, node2, node3]
|
||||
// ).await
|
||||
// },
|
||||
// ProcStack::default(),
|
||||
// );
|
||||
|
||||
scenario.teardown();
|
||||
};
|
||||
}
|
||||
// scenario.teardown();
|
||||
// };
|
||||
// }
|
|
@ -3,12 +3,27 @@ extern crate pretty_env_logger;
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
#[macro_use]
|
||||
mod chaos;
|
||||
mod base;
|
||||
use base::*;
|
||||
|
||||
use chaos::*;
|
||||
|
||||
fn main() {
|
||||
cluster_init!();
|
||||
chaos_unleash!("epidemic-periodic-index-fp");
|
||||
|
||||
kaostest!("epidemic-periodic-index-fp",
|
||||
{
|
||||
node_spawn!(node1);
|
||||
node_spawn!(node2);
|
||||
node_spawn!(node3);
|
||||
|
||||
run(
|
||||
async {
|
||||
future::join_all(
|
||||
vec![node1, node2, node3]
|
||||
).await
|
||||
},
|
||||
ProcStack::default(),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,12 +3,26 @@ extern crate pretty_env_logger;
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
#[macro_use]
|
||||
mod chaos;
|
||||
|
||||
use chaos::*;
|
||||
mod base;
|
||||
use base::*;
|
||||
|
||||
fn main() {
|
||||
cluster_init!();
|
||||
chaos_unleash!("epidemic-state-change-tail-follow-fp");
|
||||
|
||||
kaostest!("epidemic-state-change-tail-follow-fp",
|
||||
{
|
||||
node_spawn!(node1);
|
||||
node_spawn!(node2);
|
||||
node_spawn!(node3);
|
||||
|
||||
run(
|
||||
async {
|
||||
future::join_all(
|
||||
vec![node1, node2, node3]
|
||||
).await
|
||||
},
|
||||
ProcStack::default(),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#[test]
|
||||
fn kaos() {
|
||||
fn chaos_tests() {
|
||||
use std::fs;
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -26,7 +26,7 @@ fn kaos() {
|
|||
.into_os_string()
|
||||
.into_string()
|
||||
.unwrap()
|
||||
.contains("chaos")
|
||||
.contains("base")
|
||||
{
|
||||
// Every service run should be available at least 2 seconds
|
||||
k.available(path, Duration::from_secs(2));
|
||||
|
|
|
@ -3,4 +3,4 @@ extern crate pretty_env_logger;
|
|||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod chaos;
|
||||
mod base;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
extern crate pretty_env_logger;
|
||||
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
|
||||
mod base;
|
||||
use base::*;
|
||||
|
||||
fn main() {
|
||||
// cluster_init!();
|
||||
// chaos_unleash!("udp-anycast-reply-dgram-oop-fp");
|
||||
|
||||
// TODO: This will obviously pass because AP cluster doesn't use UDP anycast by default.
|
||||
// Fix it after having different prepared cluster.
|
||||
std::thread::sleep(std::time::Duration::from_secs(3));
|
||||
}
|
|
@ -8,7 +8,8 @@ use uuid::Uuid;
|
|||
use super::member::{ArtilleryMember, ArtilleryMemberState, ArtilleryStateChange};
|
||||
use crate::epidemic::member;
|
||||
use bastion_utils::math;
|
||||
use fail::fail_point;
|
||||
|
||||
use kaos::flunk;
|
||||
|
||||
pub struct ArtilleryMemberList {
|
||||
members: Vec<ArtilleryMember>,
|
||||
|
@ -73,7 +74,7 @@ impl ArtilleryMemberList {
|
|||
if other_members.is_empty() {
|
||||
None
|
||||
} else {
|
||||
fail_point!("epidemic-periodic-index-fp");
|
||||
flunk!("epidemic-periodic-index-fp");
|
||||
self.periodic_index = (self.periodic_index + 1) % other_members.len();
|
||||
Some(other_members[self.periodic_index].clone())
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ use std::sync::mpsc::{Receiver, Sender};
|
|||
use std::time::Duration;
|
||||
use uuid::Uuid;
|
||||
|
||||
use failure::_core::sync::atomic::AtomicBool;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::time::Instant;
|
||||
|
||||
use fail::fail_point;
|
||||
use kaos::flunk;
|
||||
|
||||
use crate::constants::*;
|
||||
|
||||
|
@ -495,7 +495,7 @@ fn build_message(
|
|||
};
|
||||
|
||||
for i in 0..=state_changes.len() {
|
||||
fail_point!("epidemic-state-change-tail-follow-fp");
|
||||
flunk!("epidemic-state-change-tail-follow-fp");
|
||||
message = ArtilleryMessage {
|
||||
sender: *sender,
|
||||
cluster_key: cluster_key.into(),
|
||||
|
|
|
@ -9,7 +9,7 @@ use libp2p::{identity, Multiaddr, PeerId};
|
|||
use lightproc::proc_stack::ProcStack;
|
||||
|
||||
use crossbeam_channel::{unbounded, Receiver};
|
||||
use fail::fail_point;
|
||||
use kaos::flunk;
|
||||
use std::future::Future;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
|
@ -63,7 +63,7 @@ impl MDNSServiceDiscovery {
|
|||
for addr in peer.addresses() {
|
||||
debug!(" Address = {:?}", addr);
|
||||
let components = addr.iter().collect::<Vec<_>>();
|
||||
fail_point!("mdns-protocol-fp");
|
||||
flunk!("mdns-protocol-fp");
|
||||
if let Protocol::Ip4(discovered_ip) = components[0] {
|
||||
if let Protocol::Udp(discovered_port) = components[1] {
|
||||
let discovered =
|
||||
|
|
|
@ -15,7 +15,7 @@ use std::net::SocketAddr;
|
|||
use std::sync::mpsc::{Receiver, Sender};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use fail::fail_point;
|
||||
use kaos::flunk;
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialOrd, PartialEq, Ord, Eq)]
|
||||
/// Default acknowledgement reply for the Discovery.
|
||||
|
@ -153,7 +153,7 @@ impl MulticastServiceDiscoveryState {
|
|||
while let Some(peer_addr) = self.seeker_replies.pop_front() {
|
||||
let mut sent_bytes = 0;
|
||||
while sent_bytes != discovery_reply.len() {
|
||||
fail_point!("udpanycast-reply-dgram-oob-fp");
|
||||
flunk!("udp-anycast-reply-dgram-oob-fp");
|
||||
if let Ok(bytes_tx) = self
|
||||
.server_socket
|
||||
.send_to(&discovery_reply[sent_bytes..], peer_addr)
|
||||
|
@ -173,7 +173,7 @@ impl MulticastServiceDiscoveryState {
|
|||
SEEK_NODES => {
|
||||
let mut sent_bytes = 0;
|
||||
while sent_bytes != self.seek_request.len() {
|
||||
fail_point!("udp-anycast-dgram-oob-fp");
|
||||
flunk!("udp-anycast-dgram-oob-fp");
|
||||
if let Ok(bytes_tx) = self
|
||||
.server_socket
|
||||
.send_to(&self.seek_request[sent_bytes..], self.config.seeking_addr)
|
||||
|
|
Loading…
Reference in New Issue