Skip to content

Commit e4b8d17

Browse files
committed
fix(memtrack): initialize tracker before spawning sub-process
1 parent ab0700b commit e4b8d17

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

crates/memtrack/tests/integration_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ use std::time::Duration;
99
use tempfile::TempDir;
1010

1111
pub fn track_binary(binary: &Path) -> anyhow::Result<(Vec<Event>, std::thread::JoinHandle<()>)> {
12+
let mut tracker = Tracker::new()?;
13+
1214
let child = Command::new(binary)
1315
.spawn()
1416
.context("Failed to spawn command")?;
1517
let root_pid = child.id() as i32;
1618

17-
let mut tracker = Tracker::new()?;
1819
tracker.enable()?;
1920
let rx = tracker.track(root_pid)?;
2021

0 commit comments

Comments
 (0)