Update snapshot files to standardize messageCursor redaction

- Replaced specific messageCursor values with a placeholder "[message-cursor]" across multiple snapshot files to ensure consistency in test outputs.
- Adjusted the test utility to add redaction for messageCursor, addressing non-deterministic behavior in macOS environments.
This commit is contained in:
Joe 2026-02-08 12:07:20 -06:00
parent e934912b4a
commit 6e323660e0
33 changed files with 39 additions and 34 deletions

View file

@ -22,5 +22,5 @@ instances:
Name: my-new-folder Name: my-new-folder
Parent: id-2 Parent: id-2
Properties: {} Properties: {}
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -12,5 +12,5 @@ instances:
Name: add_folder Name: add_folder
Parent: "00000000000000000000000000000000" Parent: "00000000000000000000000000000000"
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -14,5 +14,5 @@ instances:
Properties: Properties:
Source: Source:
"!String": "-- Edited contents" "!String": "-- Edited contents"
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -14,5 +14,5 @@ instances:
Properties: Properties:
Source: Source:
"!String": "-- Original contents" "!String": "-- Original contents"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -12,5 +12,5 @@ instances:
Name: empty Name: empty
Parent: "00000000000000000000000000000000" Parent: "00000000000000000000000000000000"
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -24,5 +24,5 @@ instances:
Properties: Properties:
NeedsPivotMigration: NeedsPivotMigration:
"!Bool": false "!Bool": false
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -1,7 +1,6 @@
--- ---
source: tests/tests/serve.rs source: tests/tests/serve.rs
expression: "read_response.intern_and_redact(&mut redactions, root_id)" expression: "read_response.intern_and_redact(&mut redactions, root_id)"
--- ---
instances: instances:
id-2: id-2:
@ -13,6 +12,5 @@ instances:
Name: empty_folder Name: empty_folder
Parent: "00000000000000000000000000000000" Parent: "00000000000000000000000000000000"
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -12,5 +12,5 @@ instances:
Name: forced_parent Name: forced_parent
Parent: "00000000000000000000000000000000" Parent: "00000000000000000000000000000000"
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -52,5 +52,5 @@ instances:
"!ContentId": "rbxasset://fonts/sword.mesh" "!ContentId": "rbxasset://fonts/sword.mesh"
TextureID: TextureID:
"!ContentId": "rbxasset://textures/SwordTexture.png" "!ContentId": "rbxasset://textures/SwordTexture.png"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -60,5 +60,5 @@ instances:
Properties: Properties:
NeedsPivotMigration: NeedsPivotMigration:
"!Bool": false "!Bool": false
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -142,5 +142,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": "File #5" "!String": "File #5"
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -12,5 +12,5 @@ instances:
Name: move_folder_of_stuff Name: move_folder_of_stuff
Parent: "00000000000000000000000000000000" Parent: "00000000000000000000000000000000"
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -34,5 +34,5 @@ instances:
Properties: Properties:
Value: Value:
"!Int64": 1337 "!Int64": 1337
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -34,5 +34,5 @@ instances:
Properties: Properties:
Value: Value:
"!Bool": true "!Bool": true
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -14,5 +14,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": "If this isn't named `no_name_top_level_project`, something went wrong!" "!String": "If this isn't named `no_name_top_level_project`, something went wrong!"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -14,5 +14,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": "If this isn't named `no_name_top_level_project`, something went wrong!" "!String": "If this isn't named `no_name_top_level_project`, something went wrong!"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -48,5 +48,5 @@ instances:
Properties: Properties:
NeedsPivotMigration: NeedsPivotMigration:
"!Bool": false "!Bool": false
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -130,5 +130,5 @@ instances:
Name: ProjectTarget Name: ProjectTarget
Parent: id-3 Parent: id-3
Properties: {} Properties: {}
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -112,5 +112,5 @@ instances:
Name: ProjectTarget Name: ProjectTarget
Parent: id-3 Parent: id-3
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -114,5 +114,5 @@ instances:
Name: ProjectTarget Name: ProjectTarget
Parent: id-3 Parent: id-3
Properties: {} Properties: {}
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -112,5 +112,5 @@ instances:
Name: ProjectTarget Name: ProjectTarget
Parent: id-3 Parent: id-3
Properties: {} Properties: {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -26,5 +26,5 @@ instances:
"!Attributes": {} "!Attributes": {}
Value: Value:
"!Ref": id-4 "!Ref": id-4
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -38,5 +38,5 @@ instances:
Properties: Properties:
Attributes: Attributes:
"!Attributes": {} "!Attributes": {}
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -12,5 +12,5 @@ instances:
Name: remove_file Name: remove_file
Parent: "00000000000000000000000000000000" Parent: "00000000000000000000000000000000"
Properties: {} Properties: {}
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -24,5 +24,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": This file will be removed! "!String": This file will be removed!
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -38,5 +38,5 @@ instances:
Properties: Properties:
Source: Source:
"!String": Updated foo! "!String": Updated foo!
messageCursor: 1 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -38,5 +38,5 @@ instances:
Properties: Properties:
Source: Source:
"!String": "-- Hello, from foo!" "!String": "-- Hello, from foo!"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -24,5 +24,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": "Hello, world!" "!String": "Hello, world!"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -76,5 +76,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": "Hello, from qux (a .rojo file that's turned into a StringValue)!" "!String": "Hello, from qux (a .rojo file that's turned into a StringValue)!"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -24,5 +24,5 @@ instances:
Properties: Properties:
Source: Source:
"!String": "return {\"This file has no extension but should be a ModuleScript named `no_extension`\"}" "!String": "return {\"This file has no extension but should be a ModuleScript named `no_extension`\"}"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -36,5 +36,5 @@ instances:
Properties: Properties:
Value: Value:
"!String": "If this isn't named `not_a_project`, something has gone wrong!" "!String": "If this isn't named `not_a_project`, something has gone wrong!"
messageCursor: 0 messageCursor: "[message-cursor]"
sessionId: id-1 sessionId: id-1

View file

@ -51,6 +51,10 @@ pub fn run_serve_test(test_name: &str, callback: impl FnOnce(TestServeSession, R
settings.set_snapshot_path(snapshot_path); settings.set_snapshot_path(snapshot_path);
settings.set_sort_maps(true); settings.set_sort_maps(true);
settings.add_redaction(".serverVersion", "[server-version]"); settings.add_redaction(".serverVersion", "[server-version]");
// messageCursor is non-deterministic: on macOS kqueue delivers extra
// per-file vnode events that can bump the cursor beyond what the test
// expects. The exact cursor value is irrelevant to snapshot correctness.
settings.add_redaction(".messageCursor", "[message-cursor]");
settings.bind(move || callback(session, redactions)); settings.bind(move || callback(session, redactions));
} }

View file

@ -47,8 +47,11 @@ const STRESS_OP_DELAY_MS: u64 = 250;
const STRESS_OP_DELAY_MS: u64 = 30; const STRESS_OP_DELAY_MS: u64 = 30;
/// Poll timeout for stress tests that wait for the tree to settle (ms). /// Poll timeout for stress tests that wait for the tree to settle (ms).
/// macOS kqueue generates per-file vnode events for every rename, and each
/// event triggers a re-snapshot of the parent directory. Under heavy CI load
/// (e.g., 5-file simultaneous rename chains), 15s can be insufficient.
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
const STRESS_POLL_TIMEOUT_MS: u64 = 15000; const STRESS_POLL_TIMEOUT_MS: u64 = 30000;
#[cfg(not(target_os = "macos"))] #[cfg(not(target_os = "macos"))]
const STRESS_POLL_TIMEOUT_MS: u64 = 5000; const STRESS_POLL_TIMEOUT_MS: u64 = 5000;