mirror of
https://github.com/storytold/cadcraft.git
synced 2026-10-24 02:46:51 -06:00
test(autosave): fix a flake: the owner-only folder test uses its own instance id
Two tests that start in the same millisecond got the same instance_id(), so this test's shutdown() removed the other test's lock from the process-wide SAVEFILEPATH (after #1868). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c66f6f45b8
commit
5e39af933f
@@ -226,7 +226,9 @@ fn a_new_autosave_folder_is_owner_only() {
|
|||||||
for (dir, expected) in [(base.join("new").join("autosave"), 0o700), (picked, 0o755)] {
|
for (dir, expected) in [(base.join("new").join("autosave"), 0o700), (picked, 0o755)] {
|
||||||
let mut s = Session::new();
|
let mut s = Session::new();
|
||||||
draw(&mut s);
|
draw(&mut s);
|
||||||
let mut a = Autosaver::new(autosave::instance_id());
|
// Not instance_id(): a test started in the same millisecond would get the same id, and
|
||||||
|
// shutdown() would then remove its lock from the process-wide SAVEFILEPATH.
|
||||||
|
let mut a = Autosaver::new("41-c");
|
||||||
a.plan(&s, 0.0, 1, &dir.to_string_lossy());
|
a.plan(&s, 0.0, 1, &dir.to_string_lossy());
|
||||||
let jobs = a.plan(&s, 60.0, 1, &dir.to_string_lossy());
|
let jobs = a.plan(&s, 60.0, 1, &dir.to_string_lossy());
|
||||||
let path = writes(&jobs).pop().unwrap();
|
let path = writes(&jobs).pop().unwrap();
|
||||||
|
|||||||
Reference in New Issue
Block a user