Skip to content

[DO NOT MERGE] Stress test: ExpandedFileAttributesAreUpdated flaky timestamp fix#1922

Draft
tyrielv wants to merge 2 commits intomicrosoft:masterfrom
tyrielv:tyrielv/stress-test-expanded-attrs
Draft

[DO NOT MERGE] Stress test: ExpandedFileAttributesAreUpdated flaky timestamp fix#1922
tyrielv wants to merge 2 commits intomicrosoft:masterfrom
tyrielv:tyrielv/stress-test-expanded-attrs

Conversation

@tyrielv
Copy link
Contributor

@tyrielv tyrielv commented Mar 24, 2026

No description provided.

@tyrielv tyrielv force-pushed the tyrielv/stress-test-expanded-attrs branch 5 times, most recently from cc13a42 to 98eef81 Compare March 25, 2026 17:09
tyrielv added a commit to tyrielv/VFSForGit that referenced this pull request Mar 25, 2026
The test was flaky because it set all three timestamps on a single
placeholder file at once. Setting CreationTime triggers ProjFS async
hydration, and there is a ProjFS race where LastAccessTime can be
silently dropped if it is set while hydration is still in progress.

Fix: use a separate placeholder file for each property (CreationTime,
LastAccessTime, LastWriteTime, Attributes) so each set+verify
exercises an independent placeholder-to-full transition. Each
property is verified with a retry loop using new FileInfo() on each
attempt, since ProjFS hydration is asynchronous.

Validated via stress testing in CI (PR microsoft#1922):
- Original pattern: ~22% failure rate (LastAccessTime dropped)
- Per-field pattern: verified via diagnostic tests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv force-pushed the tyrielv/stress-test-expanded-attrs branch from 98eef81 to 264a46d Compare March 25, 2026 17:45
The test was flaky because setting CreationTime on a placeholder opens
a write handle which triggers ProjFS to asynchronously hydrate the file.
When LastAccessTime was set immediately after (while hydration was still
in progress), ProjFS could silently drop the set. Diagnostics confirmed
this is deterministic: the set is lost, not overwritten later.

Fix: reorder the property sets so CreationTime (the only one that
triggers hydration via handle open) is set LAST, after LastAccessTime,
LastWriteTime, and Attributes are already pending on the placeholder.
This ensures all metadata is in place before hydration begins.

Also adds a post-hydration timestamp verification after the attribute
retry loop to confirm all three timestamps persist through hydration.

No production code in VFSForGit sets CreationTime on placeholder files,
so this ProjFS race does not affect production behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv force-pushed the tyrielv/stress-test-expanded-attrs branch 3 times, most recently from 8d917ab to 08719f4 Compare March 25, 2026 23:17
…rsions

Uses files from ForTests repo in separate directory subtrees.
Reports via Assert.Pass message so results appear in CI output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tyrielv tyrielv force-pushed the tyrielv/stress-test-expanded-attrs branch from 08719f4 to 94b7afb Compare March 25, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant