Skip to content

Commit 2d45fb6

Browse files
committed
Disable immutable digest cash in e2e
As they are not stable between two runs: they can will make fails consecutives executions by reusing the digests of the immutables from previous runs.
1 parent b5d3fc3 commit 2d45fb6

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

mithril-client/src/commands/restore.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ pub struct RestoreCommand {
2323
#[clap(long)]
2424
json: bool,
2525

26+
/// Disable immutables digest cache.
27+
#[clap(long)]
28+
disable_digest_cache: bool,
29+
2630
/// Digest of the snapshot to download. Use the `list` command to get that information.
2731
digest: String,
2832
}
@@ -51,7 +55,7 @@ impl RestoreCommand {
5155

5256
let digester = Box::new(CardanoImmutableDigester::new(
5357
Path::new(&unpacked_path).into(),
54-
build_digester_cache_provider()?,
58+
build_digester_cache_provider(self.disable_digest_cache)?,
5559
slog_scope::logger(),
5660
));
5761
let output = runtime
@@ -82,10 +86,15 @@ docker run -v cardano-node-ipc:/ipc -v cardano-node-data:/data --mount type=bind
8286
}
8387

8488
fn build_digester_cache_provider(
89+
disable_digest_cache: bool,
8590
) -> Result<Arc<dyn ImmutableFileDigestCacheProvider>, Box<dyn Error>> {
91+
if disable_digest_cache {
92+
return Ok(Arc::new(MemoryImmutableFileDigestCacheProvider::default()));
93+
}
94+
8695
match ProjectDirs::from("io", "iohk", "mithril") {
8796
None => {
88-
warn!("Could not get cache directory for immutables digests, fallback to In Memory cache provider");
97+
warn!("Could not get cache directory for immutables digests");
8998
Ok(Arc::new(MemoryImmutableFileDigestCacheProvider::default()))
9099
}
91100
Some(project_dirs) => {

mithril-test-lab/mithril-end-to-end/src/mithril/client.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ impl Client {
4242
vec!["download".to_string(), digest]
4343
}
4444
ClientCommand::Restore { digest } => {
45-
vec!["restore".to_string(), digest]
45+
vec![
46+
"restore".to_string(),
47+
// Disable immutable digests cache as they will changes between two e2e executions
48+
"--disable-digest-cache".to_string(),
49+
digest,
50+
]
4651
}
4752
};
4853

0 commit comments

Comments
 (0)