MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / test_pid_is_exclusive

Function test_pid_is_exclusive

crates/paths/src/server.rs:301–318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

299
300 #[test]
301 fn test_pid_is_exclusive() -> Result<()> {
302 let tempdir = TempDir::new()?;
303 let sdd = ServerDataDir(tempdir.path().to_path_buf());
304
305 let lock = sdd.pid_file()?;
306
307 // Make sure we wrote the pid file.
308 let pidstring = fs::read_to_string(lock.path.clone())?;
309 let _pid = pidstring.trim().parse::<u32>()?;
310
311 let attempt = sdd.pid_file();
312 assert!(attempt.is_err());
313
314 drop(lock);
315 // Make sure it can be acquired now.
316 sdd.pid_file()?;
317 Ok(())
318 }
319
320 #[test]
321 fn test_snapshot_parsing() -> Result<()> {

Callers

nothing calls this directly

Calls 5

pid_fileMethod · 0.80
newFunction · 0.50
OkFunction · 0.50
pathMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…