Commit f39c867
authored
feat(directory): Add oracle for event testing (#25477)
This change introduces a new oracle SharedDirectoryOracle for validating
ISharedDirectory
event correctness and API contracts. The oracle maintains two separate
models tracking
directory state through different event streams to ensure both event
types report changes
consistently.
Key features:
- Maintains two nested tree models: one tracking valueChanged events
(global), one tracking
containedValueChanged events (per-directory)
- Validates previousValue correctness in events, accounting for
optimistic operations and
post-clear events
- Post-clear events: previousValue has pre-clear value, oracle already
cleared → expected mismatch
- Remote ops with pending local ops: previousValue is sequenced, oracle
is optimistic → expected mismatch
- Validates actual directory state matches oracle models using
validate() method
- Subscribed events:
- valueChanged, containedValueChanged: Track key changes
- clearInternal: Track directory clears
- subDirectoryCreated, subDirectoryDeleted: Track subdirectory lifecycle
- disposed, undisposed: Handle rollback scenarios
Bugs:
[ADO#54515](https://dev.azure.com/fluidframework/internal/_workitems/edit/54515)1 parent 54584b3 commit f39c867
File tree
5 files changed
+454
-4
lines changed- packages/dds/map/src
- test
- mocha
5 files changed
+454
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1913 | 1913 | | |
1914 | 1914 | | |
1915 | 1915 | | |
| 1916 | + | |
1916 | 1917 | | |
1917 | 1918 | | |
1918 | 1919 | | |
1919 | 1920 | | |
1920 | 1921 | | |
| 1922 | + | |
1921 | 1923 | | |
1922 | 1924 | | |
1923 | 1925 | | |
| |||
0 commit comments