@fluid-experimental/tree 0.59.2001 → 0.59.3000

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.vscode/SharedTree.code-workspace +15 -0
  3. package/.vscode/settings.json +6 -0
  4. package/dist/ChangeCompression.js +9 -9
  5. package/dist/ChangeCompression.js.map +1 -1
  6. package/dist/ChangeTypes.d.ts +1 -6
  7. package/dist/ChangeTypes.d.ts.map +1 -1
  8. package/dist/ChangeTypes.js +5 -5
  9. package/dist/ChangeTypes.js.map +1 -1
  10. package/dist/Checkout.js +14 -14
  11. package/dist/Checkout.js.map +1 -1
  12. package/dist/Common.d.ts +21 -3
  13. package/dist/Common.d.ts.map +1 -1
  14. package/dist/Common.js +29 -4
  15. package/dist/Common.js.map +1 -1
  16. package/dist/EditLog.js +26 -25
  17. package/dist/EditLog.js.map +1 -1
  18. package/dist/EditUtilities.js +17 -17
  19. package/dist/EditUtilities.js.map +1 -1
  20. package/dist/Forest.js +31 -31
  21. package/dist/Forest.js.map +1 -1
  22. package/dist/HistoryEditFactory.js +9 -9
  23. package/dist/HistoryEditFactory.js.map +1 -1
  24. package/dist/IdConversion.js +9 -9
  25. package/dist/IdConversion.js.map +1 -1
  26. package/dist/Identifiers.d.ts +4 -0
  27. package/dist/Identifiers.d.ts.map +1 -1
  28. package/dist/Identifiers.js.map +1 -1
  29. package/dist/LogViewer.d.ts +1 -5
  30. package/dist/LogViewer.d.ts.map +1 -1
  31. package/dist/LogViewer.js +11 -19
  32. package/dist/LogViewer.js.map +1 -1
  33. package/dist/MergeHealth.js +2 -2
  34. package/dist/MergeHealth.js.map +1 -1
  35. package/dist/NodeIdUtilities.js +2 -2
  36. package/dist/NodeIdUtilities.js.map +1 -1
  37. package/dist/PayloadUtilities.js +1 -1
  38. package/dist/PayloadUtilities.js.map +1 -1
  39. package/dist/RevisionValueCache.d.ts +13 -10
  40. package/dist/RevisionValueCache.d.ts.map +1 -1
  41. package/dist/RevisionValueCache.js +14 -11
  42. package/dist/RevisionValueCache.js.map +1 -1
  43. package/dist/RevisionView.js +4 -4
  44. package/dist/RevisionView.js.map +1 -1
  45. package/dist/SerializationUtilities.js +4 -4
  46. package/dist/SerializationUtilities.js.map +1 -1
  47. package/dist/SharedTree.d.ts +93 -31
  48. package/dist/SharedTree.d.ts.map +1 -1
  49. package/dist/SharedTree.js +160 -131
  50. package/dist/SharedTree.js.map +1 -1
  51. package/dist/SharedTreeEncoder.d.ts +3 -3
  52. package/dist/SharedTreeEncoder.d.ts.map +1 -1
  53. package/dist/SharedTreeEncoder.js +36 -36
  54. package/dist/SharedTreeEncoder.js.map +1 -1
  55. package/dist/StringInterner.js +1 -1
  56. package/dist/StringInterner.js.map +1 -1
  57. package/dist/Summary.js +1 -1
  58. package/dist/Summary.js.map +1 -1
  59. package/dist/SummaryBackCompatibility.js +8 -8
  60. package/dist/SummaryBackCompatibility.js.map +1 -1
  61. package/dist/Transaction.js +1 -1
  62. package/dist/Transaction.js.map +1 -1
  63. package/dist/TransactionInternal.js +17 -17
  64. package/dist/TransactionInternal.js.map +1 -1
  65. package/dist/TreeCompressor.d.ts.map +1 -1
  66. package/dist/TreeCompressor.js +6 -8
  67. package/dist/TreeCompressor.js.map +1 -1
  68. package/dist/TreeNodeHandle.js +4 -4
  69. package/dist/TreeNodeHandle.js.map +1 -1
  70. package/dist/TreeView.js +7 -7
  71. package/dist/TreeView.js.map +1 -1
  72. package/dist/TreeViewUtilities.js +2 -2
  73. package/dist/TreeViewUtilities.js.map +1 -1
  74. package/dist/UndoRedoHandler.js +1 -1
  75. package/dist/UndoRedoHandler.js.map +1 -1
  76. package/dist/UuidUtilities.d.ts +30 -0
  77. package/dist/UuidUtilities.d.ts.map +1 -0
  78. package/dist/UuidUtilities.js +106 -0
  79. package/dist/UuidUtilities.js.map +1 -0
  80. package/dist/id-compressor/AppendOnlySortedMap.d.ts +52 -28
  81. package/dist/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  82. package/dist/id-compressor/AppendOnlySortedMap.js +167 -90
  83. package/dist/id-compressor/AppendOnlySortedMap.js.map +1 -1
  84. package/dist/id-compressor/IdCompressor.d.ts +43 -42
  85. package/dist/id-compressor/IdCompressor.d.ts.map +1 -1
  86. package/dist/id-compressor/IdCompressor.js +179 -177
  87. package/dist/id-compressor/IdCompressor.js.map +1 -1
  88. package/dist/id-compressor/IdRange.js +1 -1
  89. package/dist/id-compressor/IdRange.js.map +1 -1
  90. package/dist/id-compressor/NumericUuid.d.ts +6 -14
  91. package/dist/id-compressor/NumericUuid.d.ts.map +1 -1
  92. package/dist/id-compressor/NumericUuid.js +15 -76
  93. package/dist/id-compressor/NumericUuid.js.map +1 -1
  94. package/dist/id-compressor/SessionIdNormalizer.d.ts +122 -0
  95. package/dist/id-compressor/SessionIdNormalizer.d.ts.map +1 -0
  96. package/dist/id-compressor/SessionIdNormalizer.js +418 -0
  97. package/dist/id-compressor/SessionIdNormalizer.js.map +1 -0
  98. package/dist/id-compressor/persisted-types/0.0.1.d.ts +6 -13
  99. package/dist/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
  100. package/dist/id-compressor/persisted-types/0.0.1.js.map +1 -1
  101. package/dist/index.d.ts +2 -2
  102. package/dist/index.d.ts.map +1 -1
  103. package/dist/index.js.map +1 -1
  104. package/dist/persisted-types/0.1.1.d.ts +1 -6
  105. package/dist/persisted-types/0.1.1.d.ts.map +1 -1
  106. package/dist/persisted-types/0.1.1.js +3 -3
  107. package/dist/persisted-types/0.1.1.js.map +1 -1
  108. package/lib/ChangeTypes.d.ts +1 -6
  109. package/lib/ChangeTypes.d.ts.map +1 -1
  110. package/lib/Checkout.js.map +1 -1
  111. package/lib/Common.d.ts +21 -3
  112. package/lib/Common.d.ts.map +1 -1
  113. package/lib/Common.js +25 -3
  114. package/lib/Common.js.map +1 -1
  115. package/lib/EditLog.js +2 -1
  116. package/lib/EditLog.js.map +1 -1
  117. package/lib/EditUtilities.js.map +1 -1
  118. package/lib/Forest.js.map +1 -1
  119. package/lib/HistoryEditFactory.js.map +1 -1
  120. package/lib/Identifiers.d.ts +4 -0
  121. package/lib/Identifiers.d.ts.map +1 -1
  122. package/lib/Identifiers.js.map +1 -1
  123. package/lib/LogViewer.d.ts +1 -5
  124. package/lib/LogViewer.d.ts.map +1 -1
  125. package/lib/LogViewer.js +5 -13
  126. package/lib/LogViewer.js.map +1 -1
  127. package/lib/MergeHealth.js.map +1 -1
  128. package/lib/NodeIdUtilities.js.map +1 -1
  129. package/lib/RevisionValueCache.d.ts +13 -10
  130. package/lib/RevisionValueCache.d.ts.map +1 -1
  131. package/lib/RevisionValueCache.js +10 -7
  132. package/lib/RevisionValueCache.js.map +1 -1
  133. package/lib/RevisionView.js.map +1 -1
  134. package/lib/SharedTree.d.ts +93 -31
  135. package/lib/SharedTree.d.ts.map +1 -1
  136. package/lib/SharedTree.js +107 -78
  137. package/lib/SharedTree.js.map +1 -1
  138. package/lib/SharedTreeEncoder.d.ts +3 -3
  139. package/lib/SharedTreeEncoder.d.ts.map +1 -1
  140. package/lib/SharedTreeEncoder.js +4 -4
  141. package/lib/SharedTreeEncoder.js.map +1 -1
  142. package/lib/StringInterner.js.map +1 -1
  143. package/lib/Summary.js.map +1 -1
  144. package/lib/TreeCompressor.d.ts.map +1 -1
  145. package/lib/TreeCompressor.js +1 -3
  146. package/lib/TreeCompressor.js.map +1 -1
  147. package/lib/TreeNodeHandle.js.map +1 -1
  148. package/lib/TreeView.js.map +1 -1
  149. package/lib/TreeViewUtilities.js.map +1 -1
  150. package/lib/UuidUtilities.d.ts +30 -0
  151. package/lib/UuidUtilities.d.ts.map +1 -0
  152. package/lib/UuidUtilities.js +98 -0
  153. package/lib/UuidUtilities.js.map +1 -0
  154. package/lib/id-compressor/AppendOnlySortedMap.d.ts +52 -28
  155. package/lib/id-compressor/AppendOnlySortedMap.d.ts.map +1 -1
  156. package/lib/id-compressor/AppendOnlySortedMap.js +165 -88
  157. package/lib/id-compressor/AppendOnlySortedMap.js.map +1 -1
  158. package/lib/id-compressor/IdCompressor.d.ts +43 -42
  159. package/lib/id-compressor/IdCompressor.d.ts.map +1 -1
  160. package/lib/id-compressor/IdCompressor.js +97 -95
  161. package/lib/id-compressor/IdCompressor.js.map +1 -1
  162. package/lib/id-compressor/NumericUuid.d.ts +6 -14
  163. package/lib/id-compressor/NumericUuid.d.ts.map +1 -1
  164. package/lib/id-compressor/NumericUuid.js +11 -70
  165. package/lib/id-compressor/NumericUuid.js.map +1 -1
  166. package/lib/id-compressor/SessionIdNormalizer.d.ts +122 -0
  167. package/lib/id-compressor/SessionIdNormalizer.d.ts.map +1 -0
  168. package/lib/id-compressor/SessionIdNormalizer.js +414 -0
  169. package/lib/id-compressor/SessionIdNormalizer.js.map +1 -0
  170. package/lib/id-compressor/persisted-types/0.0.1.d.ts +6 -13
  171. package/lib/id-compressor/persisted-types/0.0.1.d.ts.map +1 -1
  172. package/lib/id-compressor/persisted-types/0.0.1.js.map +1 -1
  173. package/lib/index.d.ts +2 -2
  174. package/lib/index.d.ts.map +1 -1
  175. package/lib/index.js.map +1 -1
  176. package/lib/persisted-types/0.1.1.d.ts +1 -6
  177. package/lib/persisted-types/0.1.1.d.ts.map +1 -1
  178. package/lib/persisted-types/0.1.1.js.map +1 -1
  179. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts +6 -0
  180. package/lib/test/AppendOnlySortedMap.perf.tests.d.ts.map +1 -0
  181. package/lib/test/AppendOnlySortedMap.perf.tests.js +49 -0
  182. package/lib/test/AppendOnlySortedMap.perf.tests.js.map +1 -0
  183. package/lib/test/AppendOnlySortedMap.tests.js +56 -14
  184. package/lib/test/AppendOnlySortedMap.tests.js.map +1 -1
  185. package/lib/test/Checkout.tests.js +2 -2
  186. package/lib/test/Checkout.tests.js.map +1 -1
  187. package/lib/test/Forest.tests.js.map +1 -1
  188. package/lib/test/IdCompressor.perf.tests.js +8 -2
  189. package/lib/test/IdCompressor.perf.tests.js.map +1 -1
  190. package/lib/test/IdCompressor.tests.js +75 -24
  191. package/lib/test/IdCompressor.tests.js.map +1 -1
  192. package/lib/test/LogViewer.tests.js +3 -5
  193. package/lib/test/LogViewer.tests.js.map +1 -1
  194. package/lib/test/NumericUuid.perf.tests.js +4 -4
  195. package/lib/test/NumericUuid.perf.tests.js.map +1 -1
  196. package/lib/test/NumericUuid.tests.js +5 -4
  197. package/lib/test/NumericUuid.tests.js.map +1 -1
  198. package/lib/test/RevisionValueCache.tests.js.map +1 -1
  199. package/lib/test/RevisionView.tests.js.map +1 -1
  200. package/lib/test/SessionIdNormalizer.tests.d.ts +6 -0
  201. package/lib/test/SessionIdNormalizer.tests.d.ts.map +1 -0
  202. package/lib/test/SessionIdNormalizer.tests.js +299 -0
  203. package/lib/test/SessionIdNormalizer.tests.js.map +1 -0
  204. package/lib/test/Summary.tests.js +1 -1
  205. package/lib/test/Summary.tests.js.map +1 -1
  206. package/lib/test/TreeCompression.tests.js +1 -1
  207. package/lib/test/TreeCompression.tests.js.map +1 -1
  208. package/lib/test/Virtualization.tests.js +1 -1
  209. package/lib/test/Virtualization.tests.js.map +1 -1
  210. package/lib/test/fuzz/Generators.d.ts +3 -14
  211. package/lib/test/fuzz/Generators.d.ts.map +1 -1
  212. package/lib/test/fuzz/Generators.js +60 -151
  213. package/lib/test/fuzz/Generators.js.map +1 -1
  214. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts +10 -7
  215. package/lib/test/fuzz/SharedTreeFuzzTests.d.ts.map +1 -1
  216. package/lib/test/fuzz/SharedTreeFuzzTests.js +94 -104
  217. package/lib/test/fuzz/SharedTreeFuzzTests.js.map +1 -1
  218. package/lib/test/fuzz/Types.d.ts +2 -9
  219. package/lib/test/fuzz/Types.d.ts.map +1 -1
  220. package/lib/test/fuzz/Types.js +1 -1
  221. package/lib/test/fuzz/Types.js.map +1 -1
  222. package/lib/test/utilities/IdCompressorTestUtilities.d.ts +57 -11
  223. package/lib/test/utilities/IdCompressorTestUtilities.d.ts.map +1 -1
  224. package/lib/test/utilities/IdCompressorTestUtilities.js +112 -98
  225. package/lib/test/utilities/IdCompressorTestUtilities.js.map +1 -1
  226. package/lib/test/utilities/PendingLocalStateTests.d.ts.map +1 -1
  227. package/lib/test/utilities/PendingLocalStateTests.js +2 -1
  228. package/lib/test/utilities/PendingLocalStateTests.js.map +1 -1
  229. package/lib/test/utilities/SharedTreeTests.d.ts.map +1 -1
  230. package/lib/test/utilities/SharedTreeTests.js +30 -1
  231. package/lib/test/utilities/SharedTreeTests.js.map +1 -1
  232. package/lib/test/utilities/SharedTreeVersioningTests.d.ts.map +1 -1
  233. package/lib/test/utilities/SharedTreeVersioningTests.js +20 -0
  234. package/lib/test/utilities/SharedTreeVersioningTests.js.map +1 -1
  235. package/lib/test/utilities/SummaryLoadPerfTests.d.ts.map +1 -1
  236. package/lib/test/utilities/SummaryLoadPerfTests.js +6 -3
  237. package/lib/test/utilities/SummaryLoadPerfTests.js.map +1 -1
  238. package/lib/test/utilities/TestNode.js.map +1 -1
  239. package/lib/test/utilities/TestUtilities.d.ts +9 -1
  240. package/lib/test/utilities/TestUtilities.d.ts.map +1 -1
  241. package/lib/test/utilities/TestUtilities.js +27 -13
  242. package/lib/test/utilities/TestUtilities.js.map +1 -1
  243. package/package.json +19 -17
  244. package/src/Common.ts +42 -4
  245. package/src/EditLog.ts +1 -1
  246. package/src/Identifiers.ts +5 -0
  247. package/src/LogViewer.ts +4 -20
  248. package/src/RevisionValueCache.ts +11 -8
  249. package/src/SharedTree.ts +222 -75
  250. package/src/SharedTreeEncoder.ts +17 -11
  251. package/src/TreeCompressor.ts +2 -4
  252. package/src/UuidUtilities.ts +123 -0
  253. package/src/id-compressor/AppendOnlySortedMap.ts +183 -94
  254. package/src/id-compressor/IdCompressor.ts +144 -132
  255. package/src/id-compressor/NumericUuid.ts +11 -80
  256. package/src/id-compressor/SessionIdNormalizer.ts +497 -0
  257. package/src/id-compressor/persisted-types/0.0.1.ts +12 -15
  258. package/src/index.ts +5 -0
@@ -2,129 +2,119 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { promises as fs, existsSync, mkdirSync } from 'fs';
5
+ import { existsSync, mkdirSync } from 'fs';
6
6
  import { join } from 'path';
7
- import Prando from 'prando';
8
7
  import { expect } from 'chai';
8
+ import { chainAsync as chain, makeRandom, takeAsync as take, performFuzzActionsAsync as performFuzzActionsBase, } from '@fluid-internal/stochastic-test-utils';
9
9
  import { setUpLocalServerTestSharedTree, testDocumentsPathBase } from '../utilities/TestUtilities';
10
10
  import { WriteFormat } from '../../persisted-types';
11
11
  import { fail } from '../../Common';
12
12
  import { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';
13
- import { done } from './Types';
14
- import { chain, makeOpGenerator, take } from './Generators';
13
+ import { makeOpGenerator } from './Generators';
15
14
  const directory = join(testDocumentsPathBase, 'fuzz-tests');
16
15
  // TODO: Kludge: Use this to change the seed such that the tests avoid hitting bugs in the Fluid Framework.
17
16
  // Should be removed once fuzz tests pass reliably with any seed.
18
- const adjustSeed = 2;
17
+ const adjustSeed = 0;
19
18
  /**
20
19
  * Performs random actions on a set of clients.
21
- * @param generator finite generator for a sequence of Operations to test. The test will run until this generator is exhausted.
22
- * @param seed the seed for the random generation of the fuzz actions
23
- * @param synchronizeAtEnd if provided, all client will have all operations delivered from the server at the end of the test
24
- * @param saveInfo optionally provide an operation number at which a history of all operations will be saved to disk at a given filepath.
25
- * This can be useful for debugging why a fuzz test may have failed.
20
+ * @param generator - finite generator for a sequence of Operations to test. The test will run until this generator is
21
+ * exhausted.
22
+ * @param seed - the seed for the random generation of the fuzz actions
23
+ * @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of
24
+ * the test
25
+ * @param saveInfo - optionally provide an operation number at which a history of all operations will be saved to disk
26
+ * at a given filepath. This can be useful for debugging why a fuzz test may have failed.
26
27
  */
27
28
  export async function performFuzzActions(generator, seed, synchronizeAtEnd = true, saveInfo) {
28
- var _a;
29
- const rand = new Prando(seed);
29
+ const random = makeRandom(seed);
30
30
  // Note: the direct fields of `state` aren't mutated, but it is mutated transitively.
31
- const state = { rand, passiveCollaborators: [], activeCollaborators: [] };
32
- const { activeCollaborators, passiveCollaborators } = state;
33
- const operations = [];
34
- for (let operation = await generator(state, undefined); operation !== done; operation = await generator(state, undefined)) {
35
- operations.push(operation);
36
- if (saveInfo !== undefined && operations.length === saveInfo.saveAt) {
37
- await fs.writeFile(saveInfo.filepath, JSON.stringify(operations));
38
- }
39
- try {
40
- switch (operation.type) {
41
- case 'edit': {
42
- const { index, contents } = operation;
43
- const { tree } = activeCollaborators[index];
44
- switch (contents.fuzzType) {
45
- case 'insert':
46
- tree.applyEdit(contents.build, contents.insert);
47
- break;
48
- case 'delete':
49
- tree.applyEdit(contents);
50
- break;
51
- case 'move':
52
- tree.applyEdit(contents.detach, contents.insert);
53
- break;
54
- case 'setPayload':
55
- tree.applyEdit(contents);
56
- break;
57
- default:
58
- fail('Invalid edit.');
59
- break;
60
- }
31
+ const initialState = { random, passiveCollaborators: [], activeCollaborators: [] };
32
+ const finalState = await performFuzzActionsBase(generator, {
33
+ edit: async (state, operation) => {
34
+ const { index, contents } = operation;
35
+ const { tree } = state.activeCollaborators[index];
36
+ switch (contents.fuzzType) {
37
+ case 'insert':
38
+ tree.applyEdit(contents.build, contents.insert);
61
39
  break;
62
- }
63
- case 'join': {
64
- const { isObserver, summarizeHistory, writeFormat } = operation;
65
- const { container, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({
66
- writeFormat,
67
- summarizeHistory,
68
- testObjectProvider: state.testObjectProvider,
69
- });
70
- if (state.testObjectProvider === undefined) {
71
- state.testObjectProvider = testObjectProvider;
72
- }
73
- (isObserver ? passiveCollaborators : activeCollaborators).push({ container, tree });
40
+ case 'delete':
41
+ tree.applyEdit(contents);
74
42
  break;
75
- }
76
- case 'leave': {
77
- const { index, isObserver } = operation;
78
- const treeList = isObserver ? passiveCollaborators : activeCollaborators;
79
- treeList[index].container.close();
80
- treeList.splice(index, 1);
43
+ case 'move':
44
+ tree.applyEdit(contents.detach, contents.insert);
81
45
  break;
82
- }
83
- case 'synchronize': {
84
- const { testObjectProvider } = state;
85
- if (testObjectProvider === undefined) {
86
- fail('Attempted to synchronize with undefined testObjectProvider');
87
- }
88
- await testObjectProvider.ensureSynchronized();
89
- const trees = [...state.activeCollaborators, ...state.passiveCollaborators];
90
- if (trees.length > 1) {
91
- const first = trees[0].tree;
92
- for (let i = 1; i < trees.length; i++) {
93
- const tree = trees[i].tree;
94
- const editLogA = first.edits;
95
- const editLogB = tree.edits;
96
- const minEdits = Math.min(editLogA.length, editLogB.length);
97
- for (let j = 0; j < minEdits - 1; j++) {
98
- const editA = await editLogA.getEditAtIndex(editLogA.length - j - 1);
99
- const editB = await editLogB.getEditAtIndex(editLogB.length - j - 1);
100
- expect(editA.id).to.equal(editB.id);
101
- }
102
- expect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first))
103
- .to.be.true;
104
- }
105
- }
46
+ case 'setPayload':
47
+ tree.applyEdit(contents);
106
48
  break;
107
- }
108
49
  default:
109
- throw new Error('Unknown operation.');
50
+ fail('Invalid edit.');
51
+ break;
110
52
  }
111
- }
112
- catch (err) {
113
- console.log(`Error encountered on operation number ${operations.length}`);
114
- if (saveInfo !== undefined && saveInfo.saveOnFailure) {
115
- await fs.writeFile(saveInfo.filepath, JSON.stringify(operations));
53
+ return state;
54
+ },
55
+ join: async (state, operation) => {
56
+ const { isObserver, summarizeHistory, writeFormat } = operation;
57
+ const { container, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({
58
+ writeFormat,
59
+ summarizeHistory,
60
+ testObjectProvider: state.testObjectProvider,
61
+ });
62
+ (isObserver ? state.passiveCollaborators : state.activeCollaborators).push({ container, tree });
63
+ return Object.assign(Object.assign({}, state), { testObjectProvider });
64
+ },
65
+ leave: async (state, operation) => {
66
+ const { index, isObserver } = operation;
67
+ const treeList = isObserver ? state.passiveCollaborators : state.activeCollaborators;
68
+ treeList[index].container.close();
69
+ treeList.splice(index, 1);
70
+ return state;
71
+ },
72
+ synchronize: async (state) => {
73
+ const { testObjectProvider } = state;
74
+ if (testObjectProvider === undefined) {
75
+ fail('Attempted to synchronize with undefined testObjectProvider');
116
76
  }
117
- throw err;
118
- }
119
- }
77
+ await testObjectProvider.ensureSynchronized();
78
+ const trees = [...state.activeCollaborators, ...state.passiveCollaborators];
79
+ if (trees.length > 1) {
80
+ const first = trees[0].tree;
81
+ for (let i = 1; i < trees.length; i++) {
82
+ const tree = trees[i].tree;
83
+ const editLogA = first.edits;
84
+ const editLogB = tree.edits;
85
+ const minEdits = Math.min(editLogA.length, editLogB.length);
86
+ for (let j = 0; j < minEdits - 1; j++) {
87
+ const editA = await editLogA.getEditAtIndex(editLogA.length - j - 1);
88
+ const editB = await editLogB.getEditAtIndex(editLogB.length - j - 1);
89
+ expect(editA.id).to.equal(editB.id);
90
+ }
91
+ expect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first)).to
92
+ .be.true;
93
+ for (const node of tree.currentView) {
94
+ expect(tree.attributeNodeId(node.identifier)).to.equal(first.attributeNodeId(first.convertToNodeId(tree.convertToStableNodeId(node.identifier))));
95
+ }
96
+ }
97
+ }
98
+ return state;
99
+ },
100
+ }, initialState, saveInfo);
120
101
  if (synchronizeAtEnd) {
121
- await ((_a = state.testObjectProvider) === null || _a === void 0 ? void 0 : _a.ensureSynchronized());
122
- const trees = [...activeCollaborators.map(({ tree }) => tree), ...passiveCollaborators.map(({ tree }) => tree)];
102
+ if (finalState.testObjectProvider !== undefined) {
103
+ await finalState.testObjectProvider.ensureSynchronized();
104
+ const events = finalState.testObjectProvider.logger.reportAndClearTrackedEvents();
105
+ expect(events.expectedNotFound.length).to.equal(0);
106
+ // Tolerate failed edit chunk uploads, because they are fire-and-forget and can fail (e.g. the uploading client leaves before upload completes).
107
+ expect(events.unexpectedErrors.every((e) => e.eventName === 'fluid:telemetry:FluidDataStoreRuntime:SharedTree:EditChunkUploadFailure')).to.be.true;
108
+ }
109
+ const trees = [
110
+ ...finalState.activeCollaborators.map(({ tree }) => tree),
111
+ ...finalState.passiveCollaborators.map(({ tree }) => tree),
112
+ ];
123
113
  for (let i = 0; i < trees.length - 1; i++) {
124
114
  expect(trees[i].equals(trees[i + 1]));
125
115
  }
126
116
  }
127
- return state;
117
+ return finalState;
128
118
  }
129
119
  export function runSharedTreeFuzzTests(title) {
130
120
  // Some useful tips for debugging fuzz tests:
@@ -142,15 +132,15 @@ export function runSharedTreeFuzzTests(title) {
142
132
  await performFuzzActions(generatorFactory(), seed + adjustSeed, true, saveInfo);
143
133
  }).timeout(10000);
144
134
  }
145
- function runMixedVersionTests(summarizeHistory, testsPerSuite) {
135
+ function runMixedVersionTests(summarizeHistory, testsPerSuite, testLength) {
146
136
  describe('using 0.0.2 and 0.1.1 trees', () => {
147
137
  for (let seed = 0; seed < testsPerSuite; seed++) {
148
- runTest(() => take(1000, makeOpGenerator({ joinConfig: { summarizeHistory: [summarizeHistory] } })), seed);
138
+ runTest(() => take(testLength, makeOpGenerator({ joinConfig: { summarizeHistory: [summarizeHistory] } })), seed);
149
139
  }
150
140
  });
151
141
  describe('using only version 0.0.2', () => {
152
142
  for (let seed = 0; seed < testsPerSuite; seed++) {
153
- runTest(() => take(1000, makeOpGenerator({
143
+ runTest(() => take(testLength, makeOpGenerator({
154
144
  joinConfig: {
155
145
  writeFormat: [WriteFormat.v0_0_2],
156
146
  summarizeHistory: [summarizeHistory],
@@ -160,7 +150,7 @@ export function runSharedTreeFuzzTests(title) {
160
150
  });
161
151
  describe('using only version 0.1.1', () => {
162
152
  for (let seed = 0; seed < testsPerSuite; seed++) {
163
- runTest(() => take(1000, makeOpGenerator({
153
+ runTest(() => take(testLength, makeOpGenerator({
164
154
  joinConfig: {
165
155
  writeFormat: [WriteFormat.v0_1_1],
166
156
  summarizeHistory: [summarizeHistory],
@@ -169,7 +159,6 @@ export function runSharedTreeFuzzTests(title) {
169
159
  }
170
160
  });
171
161
  describe('upgrading halfway through', () => {
172
- const testLength = 500;
173
162
  const maximumActiveCollaborators = 10;
174
163
  const maximumPassiveCollaborators = 5;
175
164
  const editConfig = { maxTreeSize: 1000 };
@@ -206,11 +195,12 @@ export function runSharedTreeFuzzTests(title) {
206
195
  });
207
196
  }
208
197
  const testCount = 1;
198
+ const testLength = 200;
209
199
  describe('with no-history summarization', () => {
210
- runMixedVersionTests(false, testCount);
200
+ runMixedVersionTests(false, testCount, testLength);
211
201
  });
212
202
  describe('with history summarization', () => {
213
- runMixedVersionTests(true, testCount);
203
+ runMixedVersionTests(true, testCount, testLength);
214
204
  });
215
205
  });
216
206
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SharedTreeFuzzTests.js","sourceRoot":"","sources":["../../../src/test/fuzz/SharedTreeFuzzTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,8BAA8B,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAkB,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAiB,IAAI,EAAmD,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,SAAS,GAAG,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC;AAE5D,2GAA2G;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AC3B,WAAW,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC;wBACjC,gBAAgB,EAAE,CAAC,gBAAgB,CAAC;qBACpC;oBACD,UAAU,EAAE,CAAC;oBACb,UAAU,EAAE,CAAC;oBACb,WAAW,EAAE,CAAC;oBACd,iBAAiB,EAAE,CAAC;iBACpB,CAAC,CACF,EACD,IAAI,CACH,UAAU,GAAG,CAAC,EACd,eAAe,CAAC;oBACf,UAAU;oBACV,UAAU,EAAE;wBACX,0BAA0B;wBAC1B,2BAA2B;wBAC3B,gBAAgB,EAAE,CAAC,gBAAgB,CAAC;qBACpC;iBACD,CAAC,CACF,CACD,CAAC;gBAEH,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,aAAa,EAAE,IAAI,EAAE,EAAE;oBAChD,OAAO,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;iBAChC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,GAAG,CAAC,CAAC;QACpB,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;YAC9C,oBAAoB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;YAC3C,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { promises as fs, existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport Prando from 'prando';\nimport { expect } from 'chai';\nimport { setUpLocalServerTestSharedTree, testDocumentsPathBase } from '../utilities/TestUtilities';\nimport { ChangeInternal, WriteFormat } from '../../persisted-types';\nimport { fail } from '../../Common';\nimport { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';\nimport { EditLog } from '../../EditLog';\nimport { FuzzTestState, done, EditGenerationConfig, AsyncGenerator, Operation } from './Types';\nimport { chain, makeOpGenerator, take } from './Generators';\n\nconst directory = join(testDocumentsPathBase, 'fuzz-tests');\n\n// TODO: Kludge: Use this to change the seed such that the tests avoid hitting bugs in the Fluid Framework.\n// Should be removed once fuzz tests pass reliably with any seed.\nconst adjustSeed = 2;\n\n/**\n * Performs random actions on a set of clients.\n * @param generator finite generator for a sequence of Operations to test. The test will run until this generator is exhausted.\n * @param seed the seed for the random generation of the fuzz actions\n * @param synchronizeAtEnd if provided, all client will have all operations delivered from the server at the end of the test\n * @param saveInfo optionally provide an operation number at which a history of all operations will be saved to disk at a given filepath.\n * This can be useful for debugging why a fuzz test may have failed.\n */\nexport async function performFuzzActions(\n\tgenerator: AsyncGenerator<Operation, undefined>,\n\tseed: number,\n\tsynchronizeAtEnd: boolean = true,\n\tsaveInfo?: { saveAt?: number; saveOnFailure: boolean; filepath: string }\n): Promise<Required<FuzzTestState>> {\n\tconst rand = new Prando(seed);\n\n\t// Note: the direct fields of `state` aren't mutated, but it is mutated transitively.\n\tconst state: FuzzTestState = { rand, passiveCollaborators: [], activeCollaborators: [] };\n\tconst { activeCollaborators, passiveCollaborators } = state;\n\tconst operations: Operation[] = [];\n\tfor (\n\t\tlet operation = await generator(state, undefined);\n\t\toperation !== done;\n\t\toperation = await generator(state, undefined)\n\t) {\n\t\toperations.push(operation);\n\t\tif (saveInfo !== undefined && operations.length === saveInfo.saveAt) {\n\t\t\tawait fs.writeFile(saveInfo.filepath, JSON.stringify(operations));\n\t\t}\n\n\t\ttry {\n\t\t\tswitch (operation.type) {\n\t\t\t\tcase 'edit': {\n\t\t\t\t\tconst { index, contents } = operation;\n\t\t\t\t\tconst { tree } = activeCollaborators[index];\n\t\t\t\t\tswitch (contents.fuzzType) {\n\t\t\t\t\t\tcase 'insert':\n\t\t\t\t\t\t\ttree.applyEdit(contents.build, contents.insert);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'move':\n\t\t\t\t\t\t\ttree.applyEdit(contents.detach, contents.insert);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'setPayload':\n\t\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tfail('Invalid edit.');\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'join': {\n\t\t\t\t\tconst { isObserver, summarizeHistory, writeFormat } = operation;\n\t\t\t\t\tconst { container, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\t\t\t\t\twriteFormat,\n\t\t\t\t\t\tsummarizeHistory,\n\t\t\t\t\t\ttestObjectProvider: state.testObjectProvider,\n\t\t\t\t\t});\n\t\t\t\t\tif (state.testObjectProvider === undefined) {\n\t\t\t\t\t\tstate.testObjectProvider = testObjectProvider;\n\t\t\t\t\t}\n\t\t\t\t\t(isObserver ? passiveCollaborators : activeCollaborators).push({ container, tree });\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'leave': {\n\t\t\t\t\tconst { index, isObserver } = operation;\n\t\t\t\t\tconst treeList = isObserver ? passiveCollaborators : activeCollaborators;\n\t\t\t\t\ttreeList[index].container.close();\n\t\t\t\t\ttreeList.splice(index, 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase 'synchronize': {\n\t\t\t\t\tconst { testObjectProvider } = state;\n\t\t\t\t\tif (testObjectProvider === undefined) {\n\t\t\t\t\t\tfail('Attempted to synchronize with undefined testObjectProvider');\n\t\t\t\t\t}\n\t\t\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\t\t\tconst trees = [...state.activeCollaborators, ...state.passiveCollaborators];\n\t\t\t\t\tif (trees.length > 1) {\n\t\t\t\t\t\tconst first = trees[0].tree;\n\t\t\t\t\t\tfor (let i = 1; i < trees.length; i++) {\n\t\t\t\t\t\t\tconst tree = trees[i].tree;\n\t\t\t\t\t\t\tconst editLogA = first.edits;\n\t\t\t\t\t\t\tconst editLogB = tree.edits;\n\t\t\t\t\t\t\tconst minEdits = Math.min(editLogA.length, editLogB.length);\n\t\t\t\t\t\t\tfor (let j = 0; j < minEdits - 1; j++) {\n\t\t\t\t\t\t\t\tconst editA = await editLogA.getEditAtIndex(editLogA.length - j - 1);\n\t\t\t\t\t\t\t\tconst editB = await editLogB.getEditAtIndex(editLogB.length - j - 1);\n\t\t\t\t\t\t\t\texpect(editA.id).to.equal(editB.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\texpect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first))\n\t\t\t\t\t\t\t\t.to.be.true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('Unknown operation.');\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log(`Error encountered on operation number ${operations.length}`);\n\t\t\tif (saveInfo !== undefined && saveInfo.saveOnFailure) {\n\t\t\t\tawait fs.writeFile(saveInfo.filepath, JSON.stringify(operations));\n\t\t\t}\n\t\t\tthrow err;\n\t\t}\n\t}\n\n\tif (synchronizeAtEnd) {\n\t\tawait state.testObjectProvider?.ensureSynchronized();\n\t\tconst trees = [...activeCollaborators.map(({ tree }) => tree), ...passiveCollaborators.map(({ tree }) => tree)];\n\t\tfor (let i = 0; i < trees.length - 1; i++) {\n\t\t\texpect(trees[i].equals(trees[i + 1]));\n\t\t}\n\t}\n\n\treturn state as Required<FuzzTestState>;\n}\n\nexport function runSharedTreeFuzzTests(title: string): void {\n\t// Some useful tips for debugging fuzz tests:\n\t// - A JSON dump of the operation sequence can be written to disk by passing `true` for `saveOnFailure`.\n\t// - Different shared-tree instances can be distinguished (e.g. in logs) by using `tree.getRuntime().clientId`\n\tdescribe(title, () => {\n\t\tfunction runTest(\n\t\t\tgeneratorFactory: () => AsyncGenerator<Operation, undefined>,\n\t\t\tseed: number,\n\t\t\tsaveOnFailure?: boolean\n\t\t): void {\n\t\t\tit(`with seed ${seed}`, async () => {\n\t\t\t\tconst saveInfo =\n\t\t\t\t\tsaveOnFailure !== undefined\n\t\t\t\t\t\t? { filepath: join(directory, `test-history-${seed}.json`), saveOnFailure }\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (saveInfo !== undefined && !existsSync(directory)) {\n\t\t\t\t\tmkdirSync(directory);\n\t\t\t\t}\n\t\t\t\tawait performFuzzActions(generatorFactory(), seed + adjustSeed, true, saveInfo);\n\t\t\t}).timeout(10000);\n\t\t}\n\n\t\tfunction runMixedVersionTests(summarizeHistory: boolean, testsPerSuite: number): void {\n\t\t\tdescribe('using 0.0.2 and 0.1.1 trees', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() => take(1000, makeOpGenerator({ joinConfig: { summarizeHistory: [summarizeHistory] } })),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.0.2', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\t1000,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.1.1', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\t1000,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('upgrading halfway through', () => {\n\t\t\t\tconst testLength = 500;\n\t\t\t\tconst maximumActiveCollaborators = 10;\n\t\t\t\tconst maximumPassiveCollaborators = 5;\n\t\t\t\tconst editConfig: EditGenerationConfig = { maxTreeSize: 1000 };\n\t\t\t\tconst generatorFactory = () =>\n\t\t\t\t\tchain(\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2 - 1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators: maximumActiveCollaborators + 1,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\teditWeight: 0,\n\t\t\t\t\t\t\t\tjoinWeight: 1,\n\t\t\t\t\t\t\t\tleaveWeight: 0,\n\t\t\t\t\t\t\t\tsynchronizeWeight: 0,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(generatorFactory, seed);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tconst testCount = 1;\n\t\tdescribe('with no-history summarization', () => {\n\t\t\trunMixedVersionTests(false, testCount);\n\t\t});\n\n\t\tdescribe('with history summarization', () => {\n\t\t\trunMixedVersionTests(true, testCount);\n\t\t});\n\t});\n}\n"]}
1
+ {"version":3,"file":"SharedTreeFuzzTests.js","sourceRoot":"","sources":["../../../src/test/fuzz/SharedTreeFuzzTests.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EA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AQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;YAC3C,oBAAoB,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\nimport { expect } from 'chai';\nimport {\n\tAsyncGenerator,\n\tchainAsync as chain,\n\tmakeRandom,\n\ttakeAsync as take,\n\tperformFuzzActionsAsync as performFuzzActionsBase,\n} from '@fluid-internal/stochastic-test-utils';\nimport { setUpLocalServerTestSharedTree, testDocumentsPathBase } from '../utilities/TestUtilities';\nimport { WriteFormat } from '../../persisted-types';\nimport { fail } from '../../Common';\nimport { areRevisionViewsSemanticallyEqual } from '../../EditUtilities';\nimport { FuzzTestState, EditGenerationConfig, Operation } from './Types';\nimport { makeOpGenerator } from './Generators';\n\nconst directory = join(testDocumentsPathBase, 'fuzz-tests');\n\n// TODO: Kludge: Use this to change the seed such that the tests avoid hitting bugs in the Fluid Framework.\n// Should be removed once fuzz tests pass reliably with any seed.\nconst adjustSeed = 0;\n\n/**\n * Performs random actions on a set of clients.\n * @param generator - finite generator for a sequence of Operations to test. The test will run until this generator is\n * exhausted.\n * @param seed - the seed for the random generation of the fuzz actions\n * @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of\n * the test\n * @param saveInfo - optionally provide an operation number at which a history of all operations will be saved to disk\n * at a given filepath. This can be useful for debugging why a fuzz test may have failed.\n */\nexport async function performFuzzActions(\n\tgenerator: AsyncGenerator<Operation, FuzzTestState>,\n\tseed: number,\n\tsynchronizeAtEnd: boolean = true,\n\tsaveInfo?: { saveAt?: number; saveOnFailure: boolean; filepath: string }\n): Promise<Required<FuzzTestState>> {\n\tconst random = makeRandom(seed);\n\n\t// Note: the direct fields of `state` aren't mutated, but it is mutated transitively.\n\tconst initialState: FuzzTestState = { random, passiveCollaborators: [], activeCollaborators: [] };\n\tconst finalState = await performFuzzActionsBase(\n\t\tgenerator,\n\t\t{\n\t\t\tedit: async (state, operation) => {\n\t\t\t\tconst { index, contents } = operation;\n\t\t\t\tconst { tree } = state.activeCollaborators[index];\n\t\t\t\tswitch (contents.fuzzType) {\n\t\t\t\t\tcase 'insert':\n\t\t\t\t\t\ttree.applyEdit(contents.build, contents.insert);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'delete':\n\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'move':\n\t\t\t\t\t\ttree.applyEdit(contents.detach, contents.insert);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'setPayload':\n\t\t\t\t\t\ttree.applyEdit(contents);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfail('Invalid edit.');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tjoin: async (state, operation) => {\n\t\t\t\tconst { isObserver, summarizeHistory, writeFormat } = operation;\n\t\t\t\tconst { container, tree, testObjectProvider } = await setUpLocalServerTestSharedTree({\n\t\t\t\t\twriteFormat,\n\t\t\t\t\tsummarizeHistory,\n\t\t\t\t\ttestObjectProvider: state.testObjectProvider,\n\t\t\t\t});\n\t\t\t\t(isObserver ? state.passiveCollaborators : state.activeCollaborators).push({ container, tree });\n\t\t\t\treturn { ...state, testObjectProvider };\n\t\t\t},\n\t\t\tleave: async (state, operation) => {\n\t\t\t\tconst { index, isObserver } = operation;\n\t\t\t\tconst treeList = isObserver ? state.passiveCollaborators : state.activeCollaborators;\n\t\t\t\ttreeList[index].container.close();\n\t\t\t\ttreeList.splice(index, 1);\n\t\t\t\treturn state;\n\t\t\t},\n\t\t\tsynchronize: async (state) => {\n\t\t\t\tconst { testObjectProvider } = state;\n\t\t\t\tif (testObjectProvider === undefined) {\n\t\t\t\t\tfail('Attempted to synchronize with undefined testObjectProvider');\n\t\t\t\t}\n\t\t\t\tawait testObjectProvider.ensureSynchronized();\n\t\t\t\tconst trees = [...state.activeCollaborators, ...state.passiveCollaborators];\n\t\t\t\tif (trees.length > 1) {\n\t\t\t\t\tconst first = trees[0].tree;\n\t\t\t\t\tfor (let i = 1; i < trees.length; i++) {\n\t\t\t\t\t\tconst tree = trees[i].tree;\n\t\t\t\t\t\tconst editLogA = first.edits;\n\t\t\t\t\t\tconst editLogB = tree.edits;\n\t\t\t\t\t\tconst minEdits = Math.min(editLogA.length, editLogB.length);\n\t\t\t\t\t\tfor (let j = 0; j < minEdits - 1; j++) {\n\t\t\t\t\t\t\tconst editA = await editLogA.getEditAtIndex(editLogA.length - j - 1);\n\t\t\t\t\t\t\tconst editB = await editLogB.getEditAtIndex(editLogB.length - j - 1);\n\t\t\t\t\t\t\texpect(editA.id).to.equal(editB.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t\texpect(areRevisionViewsSemanticallyEqual(tree.currentView, tree, first.currentView, first)).to\n\t\t\t\t\t\t\t.be.true;\n\n\t\t\t\t\t\tfor (const node of tree.currentView) {\n\t\t\t\t\t\t\texpect(tree.attributeNodeId(node.identifier)).to.equal(\n\t\t\t\t\t\t\t\tfirst.attributeNodeId(\n\t\t\t\t\t\t\t\t\tfirst.convertToNodeId(tree.convertToStableNodeId(node.identifier))\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn state;\n\t\t\t},\n\t\t},\n\t\tinitialState,\n\t\tsaveInfo\n\t);\n\n\tif (synchronizeAtEnd) {\n\t\tif (finalState.testObjectProvider !== undefined) {\n\t\t\tawait finalState.testObjectProvider.ensureSynchronized();\n\t\t\tconst events = finalState.testObjectProvider.logger.reportAndClearTrackedEvents();\n\t\t\texpect(events.expectedNotFound.length).to.equal(0);\n\t\t\t// Tolerate failed edit chunk uploads, because they are fire-and-forget and can fail (e.g. the uploading client leaves before upload completes).\n\t\t\texpect(\n\t\t\t\tevents.unexpectedErrors.every(\n\t\t\t\t\t(e) => e.eventName === 'fluid:telemetry:FluidDataStoreRuntime:SharedTree:EditChunkUploadFailure'\n\t\t\t\t)\n\t\t\t).to.be.true;\n\t\t}\n\t\tconst trees = [\n\t\t\t...finalState.activeCollaborators.map(({ tree }) => tree),\n\t\t\t...finalState.passiveCollaborators.map(({ tree }) => tree),\n\t\t];\n\t\tfor (let i = 0; i < trees.length - 1; i++) {\n\t\t\texpect(trees[i].equals(trees[i + 1]));\n\t\t}\n\t}\n\n\treturn finalState as Required<FuzzTestState>;\n}\n\nexport function runSharedTreeFuzzTests(title: string): void {\n\t// Some useful tips for debugging fuzz tests:\n\t// - A JSON dump of the operation sequence can be written to disk by passing `true` for `saveOnFailure`.\n\t// - Different shared-tree instances can be distinguished (e.g. in logs) by using `tree.getRuntime().clientId`\n\tdescribe(title, () => {\n\t\tfunction runTest(\n\t\t\tgeneratorFactory: () => AsyncGenerator<Operation, FuzzTestState>,\n\t\t\tseed: number,\n\t\t\tsaveOnFailure?: boolean\n\t\t): void {\n\t\t\tit(`with seed ${seed}`, async () => {\n\t\t\t\tconst saveInfo =\n\t\t\t\t\tsaveOnFailure !== undefined\n\t\t\t\t\t\t? { filepath: join(directory, `test-history-${seed}.json`), saveOnFailure }\n\t\t\t\t\t\t: undefined;\n\t\t\t\tif (saveInfo !== undefined && !existsSync(directory)) {\n\t\t\t\t\tmkdirSync(directory);\n\t\t\t\t}\n\t\t\t\tawait performFuzzActions(generatorFactory(), seed + adjustSeed, true, saveInfo);\n\t\t\t}).timeout(10000);\n\t\t}\n\n\t\tfunction runMixedVersionTests(summarizeHistory: boolean, testsPerSuite: number, testLength: number): void {\n\t\t\tdescribe('using 0.0.2 and 0.1.1 trees', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(testLength, makeOpGenerator({ joinConfig: { summarizeHistory: [summarizeHistory] } })),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.0.2', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\ttestLength,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('using only version 0.1.1', () => {\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(\n\t\t\t\t\t\t() =>\n\t\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t\ttestLength,\n\t\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\tseed\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tdescribe('upgrading halfway through', () => {\n\t\t\t\tconst maximumActiveCollaborators = 10;\n\t\t\t\tconst maximumPassiveCollaborators = 5;\n\t\t\t\tconst editConfig: EditGenerationConfig = { maxTreeSize: 1000 };\n\t\t\t\tconst generatorFactory = () =>\n\t\t\t\t\tchain(\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2 - 1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_0_2],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators: maximumActiveCollaborators + 1,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\twriteFormat: [WriteFormat.v0_1_1],\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\teditWeight: 0,\n\t\t\t\t\t\t\t\tjoinWeight: 1,\n\t\t\t\t\t\t\t\tleaveWeight: 0,\n\t\t\t\t\t\t\t\tsynchronizeWeight: 0,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t),\n\t\t\t\t\t\ttake(\n\t\t\t\t\t\t\ttestLength / 2,\n\t\t\t\t\t\t\tmakeOpGenerator({\n\t\t\t\t\t\t\t\teditConfig,\n\t\t\t\t\t\t\t\tjoinConfig: {\n\t\t\t\t\t\t\t\t\tmaximumActiveCollaborators,\n\t\t\t\t\t\t\t\t\tmaximumPassiveCollaborators,\n\t\t\t\t\t\t\t\t\tsummarizeHistory: [summarizeHistory],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\tfor (let seed = 0; seed < testsPerSuite; seed++) {\n\t\t\t\t\trunTest(generatorFactory, seed);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tconst testCount = 1;\n\t\tconst testLength = 200;\n\t\tdescribe('with no-history summarization', () => {\n\t\t\trunMixedVersionTests(false, testCount, testLength);\n\t\t});\n\n\t\tdescribe('with history summarization', () => {\n\t\t\trunMixedVersionTests(true, testCount, testLength);\n\t\t});\n\t});\n}\n"]}
@@ -3,8 +3,8 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import type { TestObjectProvider } from '@fluidframework/test-utils';
6
- import type Prando from 'prando';
7
6
  import type { IContainer } from '@fluidframework/container-definitions';
7
+ import type { BaseFuzzTestState } from '@fluid-internal/stochastic-test-utils';
8
8
  import type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
9
9
  import type { SharedTree } from '../../SharedTree';
10
10
  import type { WriteFormat } from '../../persisted-types';
@@ -12,8 +12,7 @@ import type { Build, Detach, Insert, SetValue } from '../../ChangeTypes';
12
12
  import type { TreeView } from '../../TreeView';
13
13
  import type { NodeId } from '../../Identifiers';
14
14
  import type { NodeIdGenerator } from '../../NodeIdUtilities';
15
- export interface FuzzTestState {
16
- rand: Prando;
15
+ export interface FuzzTestState extends BaseFuzzTestState {
17
16
  testObjectProvider?: TestObjectProvider;
18
17
  activeCollaborators: Collaborator[];
19
18
  passiveCollaborators: Collaborator[];
@@ -54,12 +53,6 @@ export interface Synchronize {
54
53
  * - More fine-grained control of summarization processes
55
54
  */
56
55
  export declare type Operation = TreeEdit | TreeJoin | TreeLeave | Synchronize;
57
- export declare const done: unique symbol;
58
- /**
59
- * TAdditionalState can be used to compose generators (see treatment of how fuzzed edit changes pass in
60
- * the tree to which they apply to sub-generators)
61
- */
62
- export declare type AsyncGenerator<T, TAdditionalState> = (state: FuzzTestState, additionalState: TAdditionalState) => Promise<T | typeof done>;
63
56
  export interface FuzzInsert {
64
57
  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CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC;IAC7B;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,sDAAsD;IACtD,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,sDAAsD;IACtD,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,MAAM,WAAW,yBAAyB;IACzC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,kBAAkB;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B"}
@@ -2,5 +2,5 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export const done = Symbol('GeneratorDone');
5
+ export {};
6
6
  //# sourceMappingURL=Types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Types.js","sourceRoot":"","sources":["../../../src/test/fuzz/Types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA8DH,MAAM,CAAC,MAAM,IAAI,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TestObjectProvider } from '@fluidframework/test-utils';\nimport type Prando from 'prando';\nimport type { IContainer } from '@fluidframework/container-definitions';\nimport type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';\nimport type { SharedTree } from '../../SharedTree';\nimport type { WriteFormat } from '../../persisted-types';\nimport type { Build, Detach, Insert, SetValue } from '../../ChangeTypes';\nimport type { TreeView } from '../../TreeView';\nimport type { NodeId } from '../../Identifiers';\nimport type { NodeIdGenerator } from '../../NodeIdUtilities';\n\nexport interface FuzzTestState {\n\trand: Prando;\n\ttestObjectProvider?: TestObjectProvider;\n\tactiveCollaborators: Collaborator[];\n\tpassiveCollaborators: Collaborator[];\n}\n\nexport interface Collaborator {\n\tcontainer: IContainer;\n\ttree: SharedTree;\n}\n\nexport interface TreeEdit {\n\ttype: 'edit';\n\tcontents: FuzzChange;\n\t/** index of the tree to apply the edit to. */\n\tindex: number;\n}\n\nexport interface TreeJoin {\n\ttype: 'join';\n\tsummarizeHistory: boolean;\n\twriteFormat: WriteFormat;\n\tisObserver: boolean;\n}\n\nexport interface TreeLeave {\n\ttype: 'leave';\n\tisObserver: boolean;\n\tindex: number;\n}\n\nexport interface Synchronize {\n\ttype: 'synchronize';\n}\n\n/**\n * Operations:\n * - Any valid edit on any shared tree\n * - New SharedTree joins session with some initial params\n * - Existing SharedTree leaves session\n * - Local server synchronizes connected clients\n *\n * Note that these objects should be JSON serializable for ease in debugging fuzz tests.\n * Future potential work:\n * - More fine-grained control of summarization processes\n */\nexport type Operation = TreeEdit | TreeJoin | TreeLeave | Synchronize;\n\nexport const done = Symbol('GeneratorDone');\n\n/**\n * TAdditionalState can be used to compose generators (see treatment of how fuzzed edit changes pass in\n * the tree to which they apply to sub-generators)\n */\nexport type AsyncGenerator<T, TAdditionalState> = (\n\tstate: FuzzTestState,\n\tadditionalState: TAdditionalState\n) => Promise<T | typeof done>;\n\nexport interface FuzzInsert {\n\tfuzzType: 'insert';\n\tbuild: Build;\n\tinsert: Insert;\n}\n\nexport type FuzzDelete = Detach & { fuzzType: 'delete' };\n\nexport interface FuzzMove {\n\tfuzzType: 'move';\n\tdetach: Detach;\n\tinsert: Insert;\n}\n\nexport type FuzzSetPayload = SetValue & { fuzzType: 'setPayload' };\n\nexport type FuzzChange = FuzzInsert | FuzzDelete | FuzzMove | FuzzSetPayload;\n\nexport interface TreeContext {\n\tview: TreeView;\n\tidGenerator: NodeIdGenerator;\n\tidList: NodeId[];\n\tdataStoreRuntime: IFluidDataStoreRuntime;\n}\n\nexport interface InsertGenerationConfig {\n\t/** default: 3 */\n\tmaxTreeSequenceSize?: number;\n\t/** The number of possible definitions. Default: 20. */\n\tdefinitionPoolSize?: number;\n}\n\nexport interface EditGenerationConfig {\n\t/** default: Number.POSITIVE_INFINITY (no max size) */\n\tmaxTreeSize?: number;\n\t/** default: 3 */\n\tinsertWeight?: number;\n\t/** default: 1 */\n\tdeleteWeight?: number;\n\t/** default: 1 */\n\tmoveWeight?: number;\n\t/** default: 1 */\n\tsetPayloadWeight?: number;\n\tinsertConfig?: InsertGenerationConfig;\n\t/** The number of possible trait labels. Default: 20. */\n\ttraitLabelPoolSize?: number;\n}\n\nexport interface JoinGenerationConfig {\n\t/**\n\t * Valid `summarizeHistory` values. Defaults to [false].\n\t */\n\tsummarizeHistory?: boolean[];\n\t/**\n\t * Valid `writeFormat` values. Defaults to 0.0.2 and 0.1.1.\n\t */\n\twriteFormat?: WriteFormat[];\n\t/** default: Number.POSITIVE_INFINITY (no max size) */\n\tmaximumPassiveCollaborators?: number;\n\t/** default: Number.POSITIVE_INFINITY (no max size) */\n\tmaximumActiveCollaborators?: number;\n}\n\nexport interface OperationGenerationConfig {\n\teditConfig?: EditGenerationConfig;\n\tjoinConfig?: JoinGenerationConfig;\n\t/** default: 10 */\n\teditWeight?: number;\n\t/** default: 1 */\n\tjoinWeight?: number;\n\t/** default: 1 */\n\tleaveWeight?: number;\n\t/** default: 1 */\n\tsynchronizeWeight?: number;\n}\n"]}
1
+ {"version":3,"file":"Types.js","sourceRoot":"","sources":["../../../src/test/fuzz/Types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type { TestObjectProvider } from '@fluidframework/test-utils';\nimport type { IContainer } from '@fluidframework/container-definitions';\nimport type { BaseFuzzTestState } from '@fluid-internal/stochastic-test-utils';\nimport type { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';\nimport type { SharedTree } from '../../SharedTree';\nimport type { WriteFormat } from '../../persisted-types';\nimport type { Build, Detach, Insert, SetValue } from '../../ChangeTypes';\nimport type { TreeView } from '../../TreeView';\nimport type { NodeId } from '../../Identifiers';\nimport type { NodeIdGenerator } from '../../NodeIdUtilities';\n\nexport interface FuzzTestState extends BaseFuzzTestState {\n\ttestObjectProvider?: TestObjectProvider;\n\tactiveCollaborators: Collaborator[];\n\tpassiveCollaborators: Collaborator[];\n}\n\nexport interface Collaborator {\n\tcontainer: IContainer;\n\ttree: SharedTree;\n}\n\nexport interface TreeEdit {\n\ttype: 'edit';\n\tcontents: FuzzChange;\n\t/** index of the tree to apply the edit to. */\n\tindex: number;\n}\n\nexport interface TreeJoin {\n\ttype: 'join';\n\tsummarizeHistory: boolean;\n\twriteFormat: WriteFormat;\n\tisObserver: boolean;\n}\n\nexport interface TreeLeave {\n\ttype: 'leave';\n\tisObserver: boolean;\n\tindex: number;\n}\n\nexport interface Synchronize {\n\ttype: 'synchronize';\n}\n\n/**\n * Operations:\n * - Any valid edit on any shared tree\n * - New SharedTree joins session with some initial params\n * - Existing SharedTree leaves session\n * - Local server synchronizes connected clients\n *\n * Note that these objects should be JSON serializable for ease in debugging fuzz tests.\n * Future potential work:\n * - More fine-grained control of summarization processes\n */\nexport type Operation = TreeEdit | TreeJoin | TreeLeave | Synchronize;\n\nexport interface FuzzInsert {\n\tfuzzType: 'insert';\n\tbuild: Build;\n\tinsert: Insert;\n}\n\nexport type FuzzDelete = Detach & { fuzzType: 'delete' };\n\nexport interface FuzzMove {\n\tfuzzType: 'move';\n\tdetach: Detach;\n\tinsert: Insert;\n}\n\nexport type FuzzSetPayload = SetValue & { fuzzType: 'setPayload' };\n\nexport type FuzzChange = FuzzInsert | FuzzDelete | FuzzMove | FuzzSetPayload;\n\nexport interface TreeContext {\n\tview: TreeView;\n\tidGenerator: NodeIdGenerator;\n\tidList: NodeId[];\n\tdataStoreRuntime: IFluidDataStoreRuntime;\n}\n\nexport interface InsertGenerationConfig {\n\t/** default: 3 */\n\tmaxTreeSequenceSize?: number;\n\t/** The number of possible definitions. Default: 20. */\n\tdefinitionPoolSize?: number;\n}\n\nexport interface EditGenerationConfig {\n\t/** default: Number.POSITIVE_INFINITY (no max size) */\n\tmaxTreeSize?: number;\n\t/** default: 3 */\n\tinsertWeight?: number;\n\t/** default: 1 */\n\tdeleteWeight?: number;\n\t/** default: 1 */\n\tmoveWeight?: number;\n\t/** default: 1 */\n\tsetPayloadWeight?: number;\n\tinsertConfig?: InsertGenerationConfig;\n\t/** The number of possible trait labels. Default: 20. */\n\ttraitLabelPoolSize?: number;\n}\n\nexport interface JoinGenerationConfig {\n\t/**\n\t * Valid `summarizeHistory` values. Defaults to [false].\n\t */\n\tsummarizeHistory?: boolean[];\n\t/**\n\t * Valid `writeFormat` values. Defaults to 0.0.2 and 0.1.1.\n\t */\n\twriteFormat?: WriteFormat[];\n\t/** default: Number.POSITIVE_INFINITY (no max size) */\n\tmaximumPassiveCollaborators?: number;\n\t/** default: Number.POSITIVE_INFINITY (no max size) */\n\tmaximumActiveCollaborators?: number;\n}\n\nexport interface OperationGenerationConfig {\n\teditConfig?: EditGenerationConfig;\n\tjoinConfig?: JoinGenerationConfig;\n\t/** default: 10 */\n\teditWeight?: number;\n\t/** default: 1 */\n\tjoinWeight?: number;\n\t/** default: 1 */\n\tleaveWeight?: number;\n\t/** default: 1 */\n\tsynchronizeWeight?: number;\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import { Serializable } from '@fluidframework/datastore-definitions';
5
+ import { Generator, SaveInfo, BaseFuzzTestState } from '@fluid-internal/stochastic-test-utils';
6
6
  import { ClosedMap } from '../../Common';
7
7
  import { IdCompressor, IdRangeDescriptor } from '../../id-compressor/IdCompressor';
8
8
  import { NumericUuid } from '../../id-compressor/NumericUuid';
9
- import { SessionId, StableId, SessionSpaceCompressedId } from '../../Identifiers';
9
+ import { SessionId, StableId, SessionSpaceCompressedId, AttributionId } from '../../Identifiers';
10
10
  import type { IdCreationRange, SerializedIdCompressorWithOngoingSession, SerializedIdCompressorWithNoSession } from '../../id-compressor';
11
11
  /** Identifies a compressor in a network */
12
12
  export declare enum Client {
@@ -44,7 +44,7 @@ export declare const DestinationClient: {
44
44
  /**
45
45
  * Creates a new compressor with the supplied cluster capacity.
46
46
  */
47
- export declare function createCompressor<T>(client: Client, clusterCapacity?: number, attributionInfo?: Serializable<T>): IdCompressor;
47
+ export declare function createCompressor(client: Client, clusterCapacity?: number, attributionId?: AttributionId): IdCompressor;
48
48
  /**
49
49
  * A closed map from NamedClient to T.
50
50
  */
@@ -57,6 +57,7 @@ export declare const sessionIds: ClientMap<SessionId>;
57
57
  * An array of session uuids corresponding to all non-local `Client` entries.
58
58
  */
59
59
  export declare const sessionNumericUuids: ClientMap<NumericUuid>;
60
+ export declare const attributionIds: ClientMap<import("../../Identifiers").UuidString>;
60
61
  /** An immutable view of an `IdCompressor` */
61
62
  export interface ReadonlyIdCompressor extends Omit<IdCompressor, 'generateCompressedId' | 'generateCompressedIdRange' | 'takeNextCreationRange' | 'finalizeCreationRange'> {
62
63
  readonly clusterCapacity: number;
@@ -158,17 +159,61 @@ export declare function expectSerializes(compressor: ReadonlyIdCompressor): [Ser
158
159
  * Merges 'from' into 'to', and returns 'to'.
159
160
  */
160
161
  export declare function mergeArrayMaps<K, V>(to: Pick<Map<K, V[]>, 'get' | 'set'>, from: ReadonlyMap<K, V[]>): Pick<Map<K, V[]>, 'get' | 'set'>;
162
+ interface AllocateIds {
163
+ type: 'allocateIds';
164
+ client: Client;
165
+ numIds: number;
166
+ overrides: {
167
+ [index: number]: string;
168
+ };
169
+ }
170
+ interface DeliverOperations {
171
+ type: 'deliverOperations';
172
+ client: DestinationClient;
173
+ }
174
+ interface ChangeCapacity {
175
+ type: 'changeCapacity';
176
+ newSize: number;
177
+ }
178
+ interface GenerateUnifyingIds {
179
+ type: 'generateUnifyingIds';
180
+ clientA: Client;
181
+ clientB: Client;
182
+ uuid: string;
183
+ }
184
+ interface Reconnect {
185
+ type: 'reconnect';
186
+ client: Client;
187
+ }
188
+ interface Validate {
189
+ type: 'validate';
190
+ }
191
+ declare type Operation = AllocateIds | DeliverOperations | ChangeCapacity | GenerateUnifyingIds | Reconnect | Validate;
192
+ interface FuzzTestState extends BaseFuzzTestState {
193
+ network: IdCompressorTestNetwork;
194
+ activeClients: Client[];
195
+ selectableClients: Client[];
196
+ clusterSize: number;
197
+ }
198
+ export interface OperationGenerationConfig {
199
+ /** whether or not the fuzz actions will generate override UUIDs */
200
+ includeOverrides: boolean;
201
+ /** maximum cluster size of the network. Default: 25 */
202
+ maxClusterSize?: number;
203
+ /** Number of ops between validation ops. Default: 200 */
204
+ validateInterval?: number;
205
+ }
206
+ export declare function makeOpGenerator(options: OperationGenerationConfig): Generator<Operation, FuzzTestState>;
161
207
  /**
162
208
  * Performs random actions on a test network.
163
- * @param network the test network to test
164
- * @param seed the seed for the random generation of the fuzz actions
165
- * @param includeOverrides whether or not the fuzz actions will generate override UUIDs
166
- * @param observerClient if provided, this client will never generate local ids
167
- * @param synchronizeAtEnd if provided, all client will have all operations delivered from the server at the end of the test
168
- * @param numUsages if provided, the number of operations to perform as part of this test. Defaults to 1000.
169
- * @param validator if provided, this callback will be invoked periodically during the fuzz test.
209
+ * @param generator - the generator used to provide operations
210
+ * @param network - the test network to test
211
+ * @param seed - the seed for the random generation of the fuzz actions
212
+ * @param observerClient - if provided, this client will never generate local ids
213
+ * @param synchronizeAtEnd - if provided, all client will have all operations delivered from the server at the end of the test
214
+ * @param validator - if provided, this callback will be invoked periodically during the fuzz test.
170
215
  */
171
- export declare function performFuzzActions(network: IdCompressorTestNetwork, seed: number, includeOverrides: boolean, observerClient?: Client, synchronizeAtEnd?: boolean, numUsages?: number, maxClusterSize?: number, validator?: (network: IdCompressorTestNetwork) => void): void;
216
+ export declare function performFuzzActions(generator: Generator<Operation, FuzzTestState>, network: IdCompressorTestNetwork, seed: number, observerClient?: Client, synchronizeAtEnd?: boolean, validator?: (network: IdCompressorTestNetwork) => void, saveInfo?: SaveInfo): void;
172
217
  /**
173
218
  * Converts the supplied integer to a uuid.
174
219
  */
@@ -177,4 +222,5 @@ export declare function integerToStableId(num: number | bigint): StableId;
177
222
  * Pads the strings to a length of 32 with zeroes.
178
223
  */
179
224
  export declare function padToUuidLength(str: string): string;
225
+ export {};
180
226
  //# sourceMappingURL=IdCompressorTestUtilities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IdCompressorTestUtilities.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/IdCompressorTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAA8B,SAAS,EAAqB,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAa,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAIN,WAAW,EAGX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAqB,SAAS,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAErG,OAAO,KAAK,EACX,eAAe,EACf,wCAAwC,EACxC,mCAAmC,EACnC,MAAM,qBAAqB,CAAC;AAE7B,2CAA2C;AAC3C,oBAAY,MAAM;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;CACnB;AAED,mEAAmE;AACnE,oBAAY,cAAc;IACzB,WAAW,gBAAgB;CAC3B;AAED,2CAA2C;AAC3C,oBAAY,UAAU;IACrB,GAAG,QAAQ;CACX;AAED;;;GAGG;AACH,oBAAY,iBAAiB,GAAG,MAAM,GAAG,cAAc,CAAC;AACxD,eAAO,MAAM,iBAAiB;;;;;CAAmC,CAAC;AAEl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,CACxB,UAAU,EAAE,oBAAoB,EAChC,WAAW,EAAE,IAAI,GACf,CAAC,wCAAwC,EAAE,YAAY,CAAC,CAAC;AAE5D;;GAEG;AACH,wBAAgB,SAAS,CACxB,UAAU,EAAE,oBAAoB,EAChC,WAAW,EAAE,KAAK,GAChB,CAAC,mCAAmC,EAAE,YAAY,CAAC,CAAC;AAevD;;GAEG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE,oBAAoB,GAC9B,CAAC,mCAAmC,EAAE,wCAAwC,CAAC,CA0CjF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAClC,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,EACpC,IAAI,EAAE,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GACvB,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,CAUlC;AAUD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,uBAAuB,EAChC,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,OAAO,EACzB,cAAc,CAAC,EAAE,MAAM,EACvB,gBAAgB,GAAE,OAAc,EAChC,SAAS,SAAO,EAChB,cAAc,SAAK,EACnB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,IAAI,GACpD,IAAI,CAuFN;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAYhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD"}
1
+ {"version":3,"file":"IdCompressorTestUtilities.d.ts","sourceRoot":"","sources":["../../../src/test/utilities/IdCompressorTestUtilities.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAK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