Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PVF: Add test instructions #2058

Merged
merged 14 commits into from
Nov 28, 2023
Prev Previous commit
Next Next commit
Merge branch 'master' into mrcnski/pvf-test-instructions
mrcnski committed Nov 19, 2023
commit 714ef9a507ed118bc6da55409318d85ed0e73c59
2 changes: 1 addition & 1 deletion polkadot/node/core/pvf/prepare-worker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ use nix::{
use os_pipe::{self, PipeReader, PipeWriter};
use parity_scale_codec::{Decode, Encode};
use polkadot_node_core_pvf_common::{
error::{PrepareError, PrepareResult, OOM_PAYLOAD},
error::{PrepareError, PrepareWorkerResult},
executor_interface::create_runtime_from_artifact_bytes,
framed_recv_blocking, framed_send_blocking,
prepare::{MemoryStats, PrepareJobKind, PrepareStats, PrepareWorkerSuccess},
10 changes: 3 additions & 7 deletions polkadot/node/core/pvf/src/artifacts.rs
Original file line number Diff line number Diff line change
@@ -498,13 +498,9 @@ mod tests {
}

#[tokio::test]
async fn artifacts_removes_cache_on_startup() {
let fake_cache_path = crate::worker_interface::tmppath("test-cache").await.unwrap();
let fake_artifact_path = {
let mut p = fake_cache_path.clone();
p.push("wasmtime_0x1234567890123456789012345678901234567890123456789012345678901234");
p
};
async fn remove_stale_cache_on_startup() {
let cache_dir = crate::worker_interface::tmppath("test-cache").await.unwrap();
fs::create_dir_all(&cache_dir).unwrap();

// invalid prefix
create_rand_artifact(&cache_dir, "");
2 changes: 1 addition & 1 deletion polkadot/node/core/pvf/src/prepare/pool.rs
Original file line number Diff line number Diff line change
@@ -306,7 +306,7 @@ async fn start_work_task<Timer>(
cache_path: PathBuf,
_preparation_timer: Option<Timer>,
) -> PoolEvent {
let outcome = worker_interface::start_work(&metrics, idle, pvf, artifact_path).await;
let outcome = worker_interface::start_work(&metrics, idle, pvf, cache_path).await;
PoolEvent::StartWork(worker, outcome)
}

You are viewing a condensed version of this merge commit. You can view the full changes here.