-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use logs instead of timing to determine if the package cache was hit
- Loading branch information
Michael-F-Bryan
committed
Jun 7, 2023
1 parent
fe1b440
commit 2993892
Showing
2 changed files
with
14 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected]") | ||
.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 | ||
|