mirror of
https://github.com/logos-blockchain/logos-blockchain-testing.git
synced 2026-01-02 13:23:13 +00:00
Extend CI smoke runs to 120s
This commit is contained in:
parent
de24524d25
commit
ec4a1e26e5
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@ -259,7 +259,7 @@ jobs:
|
||||
RUST_LOG: "info"
|
||||
NOMOS_LOG_DIR: "${{ runner.temp }}/local-logs"
|
||||
run: |
|
||||
scripts/run-examples.sh -t 60 -v 1 -e 1 host
|
||||
scripts/run-examples.sh -t 120 -v 1 -e 1 host
|
||||
- name: Collect host demo logs (on failure)
|
||||
if: failure()
|
||||
run: |
|
||||
@ -405,7 +405,7 @@ jobs:
|
||||
NOMOS_LOG_DIR: "${{ github.workspace }}/.tmp/compose-logs"
|
||||
run: |
|
||||
mkdir -p "$TMPDIR"
|
||||
scripts/run-examples.sh -t 60 -v 1 -e 1 compose
|
||||
scripts/run-examples.sh -t 120 -v 1 -e 1 compose
|
||||
|
||||
- name: Show compose runner log
|
||||
env:
|
||||
|
||||
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -7323,6 +7323,7 @@ name = "testing-framework-workflows"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"chain-service",
|
||||
"ed25519-dalek",
|
||||
"executor-http-client",
|
||||
"nomos-core",
|
||||
|
||||
@ -14,6 +14,7 @@ workspace = true
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1"
|
||||
chain-service = { git = "https://github.com/logos-co/nomos-node", rev = "d2dd5a5084e1daef4032562c77d41de5e4d495f8" }
|
||||
ed25519-dalek = { version = "2.2.0", features = ["rand_core", "serde"] }
|
||||
executor-http-client = { workspace = true }
|
||||
nomos-core = { workspace = true }
|
||||
@ -24,3 +25,6 @@ thiserror = { workspace = true }
|
||||
tokio = { workspace = true, features = ["macros", "net", "rt-multi-thread", "time"] }
|
||||
tracing = { workspace = true }
|
||||
zksign = { workspace = true }
|
||||
|
||||
[package.metadata.cargo-machete]
|
||||
ignored = ["chain-service"]
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use nomos_core::header::HeaderId;
|
||||
use testing_framework_core::scenario::{DynError, Expectation, RunContext};
|
||||
use thiserror::Error;
|
||||
use tokio::time::sleep;
|
||||
@ -51,6 +52,12 @@ enum ConsensusLivenessIssue {
|
||||
height: u64,
|
||||
target: u64,
|
||||
},
|
||||
#[error("{node} LIB {lib:?} diverged from reference {reference_lib:?}")]
|
||||
LibDiverged {
|
||||
node: String,
|
||||
lib: HeaderId,
|
||||
reference_lib: HeaderId,
|
||||
},
|
||||
#[error("{node} consensus_info failed: {source}")]
|
||||
RequestFailed {
|
||||
node: String,
|
||||
@ -98,11 +105,13 @@ impl ConsensusLiveness {
|
||||
let mut issues = Vec::new();
|
||||
|
||||
for attempt in 0..max_attempts {
|
||||
match Self::fetch_cluster_height(ctx).await {
|
||||
Ok(height) => {
|
||||
match Self::fetch_cluster_info(ctx).await {
|
||||
Ok((height, lib, tip)) => {
|
||||
samples.push(NodeSample {
|
||||
label: format!("sample-{attempt}"),
|
||||
height,
|
||||
lib,
|
||||
tip,
|
||||
});
|
||||
if samples.len() >= participant_count {
|
||||
break;
|
||||
@ -122,14 +131,14 @@ impl ConsensusLiveness {
|
||||
LivenessCheck { samples, issues }
|
||||
}
|
||||
|
||||
async fn fetch_cluster_height(ctx: &RunContext) -> Result<u64, DynError> {
|
||||
async fn fetch_cluster_info(ctx: &RunContext) -> Result<(u64, HeaderId, HeaderId), DynError> {
|
||||
ctx.cluster_client()
|
||||
.try_all_clients(|client| {
|
||||
Box::pin(async move {
|
||||
client
|
||||
.consensus_info()
|
||||
.await
|
||||
.map(|info| info.height)
|
||||
.map(|info| (info.height, info.lib, info.tip))
|
||||
.map_err(|err| -> DynError { err.into() })
|
||||
})
|
||||
})
|
||||
@ -170,6 +179,7 @@ impl ConsensusLiveness {
|
||||
});
|
||||
}
|
||||
|
||||
let reference_lib = check.samples.first().map(|s| s.lib);
|
||||
for sample in &check.samples {
|
||||
if sample.height + self.lag_allowance < target {
|
||||
check
|
||||
@ -180,12 +190,23 @@ impl ConsensusLiveness {
|
||||
target,
|
||||
});
|
||||
}
|
||||
if let Some(lib) = reference_lib {
|
||||
if sample.lib != lib {
|
||||
check.issues.push(ConsensusLivenessIssue::LibDiverged {
|
||||
node: sample.label.clone(),
|
||||
lib: sample.lib,
|
||||
reference_lib: lib,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if check.issues.is_empty() {
|
||||
tracing::info!(
|
||||
target,
|
||||
heights = ?check.samples.iter().map(|s| s.height).collect::<Vec<_>>(),
|
||||
libs = ?check.samples.iter().map(|s| s.lib).collect::<Vec<_>>(),
|
||||
tips = ?check.samples.iter().map(|s| s.tip).collect::<Vec<_>>(),
|
||||
"consensus liveness expectation satisfied"
|
||||
);
|
||||
Ok(())
|
||||
@ -201,6 +222,8 @@ impl ConsensusLiveness {
|
||||
struct NodeSample {
|
||||
label: String,
|
||||
height: u64,
|
||||
lib: HeaderId,
|
||||
tip: HeaderId,
|
||||
}
|
||||
|
||||
struct LivenessCheck {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user