diff --git a/lib/wasi/src/runtime/package_loader/builtin_loader.rs b/lib/wasi/src/runtime/package_loader/builtin_loader.rs index ea1f62da2c5..749bf5a8b9b 100644 --- a/lib/wasi/src/runtime/package_loader/builtin_loader.rs +++ b/lib/wasi/src/runtime/package_loader/builtin_loader.rs @@ -79,7 +79,7 @@ impl BuiltinPackageLoader { if let Some(cached) = self.fs.lookup(hash).await? { // Note: We want to propagate it to the in-memory cache, too - tracing::debug!("Copying from the filesystem cache to the in-memory cache",); + tracing::debug!("Copying from the filesystem cache to the in-memory cache"); self.in_memory.save(&cached, *hash); return Ok(Some(cached)); } diff --git a/tests/integration/cli/tests/run.rs b/tests/integration/cli/tests/run.rs index 8e660a64584..dbf88df15f7 100644 --- a/tests/integration/cli/tests/run.rs +++ b/tests/integration/cli/tests/run.rs @@ -497,19 +497,24 @@ fn run_test_caching_works_for_packages_with_versions() { assert.stdout("hello\n"); - let time = std::time::Instant::now(); - let assert = Command::new(get_wasmer_path()) .arg("python/python@0.1.0") .arg(format!("--mapdir=/app:{}", ASSET_PATH)) .arg("/app/test.py") - .assert() - .success(); - - assert.stdout("hello\n"); + .env( + "RUST_LOG", + "wasmer_wasix::runtime::package_loader::builtin_loader=debug", + ) + .assert(); - // package should be cached - assert!(std::time::Instant::now() - time < std::time::Duration::from_secs(1)); + assert + .success() + // it should have ran like normal + .stdout("hello\n") + // we hit the cache while fetching the package + .stderr(contains( + "builtin_loader: Cache hit! pkg.name=\"python\" pkg.version=0.1.0", + )); } // FIXME: Re-enable. See https://github.com/wasmerio/wasmer/issues/3717