FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

Add TestOverride setting for SweepTimeout

Open markfields opened this issue 3 years ago • 1 comments

We need a way to shrink the SweepTimeout value for manual testing of sweep flows.

Reviewing tip: Start with the tests! See if you agree with that "spec", then see how I implemented it

WARNING if you mix and match this value with the default computed value in different sessions for a single document, you can wrongly trigger sweep earlier than is valid. This is mostly protected against by the fact that SweepTimeout can't be smaller than the persisted value of SessionExpiry, so it's not very useful on existing documents.

markfields avatar Sep 20 '22 17:09 markfields

@fluid-example/bundle-size-tests: +840 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 396.43 KB 396.84 KB +420 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 195.56 KB 195.97 KB +420 Bytes
loader.js 153.92 KB 153.92 KB No change
map.js 42.79 KB 42.79 KB No change
matrix.js 131.73 KB 131.73 KB No change
odspDriver.js 150.52 KB 150.52 KB No change
odspPrefetchSnapshot.js 38.59 KB 38.59 KB No change
sharedString.js 152.94 KB 152.94 KB No change
Total Size 1.27 MB 1.27 MB +840 Bytes

Baseline commit: 5caef335814a45820ea2c8d85da9acd74f175712

Generated by :no_entry_sign: dangerJS against 60882c7c6f7930aba7c5027bdf8a9f8e69eb4a59

msfluid-bot avatar Sep 20 '22 17:09 msfluid-bot

After further thinking, I'm planning to get Sweep Timeout consistent for lifetime of file and then include TestOverride at that point. First PR towards this end is #12118. Next will be to store that boolean policy as well as the Buffer in the snapshot.

markfields avatar Sep 26 '22 17:09 markfields

Next step: Take changes from this, and these two branches, and finish this up:

  • https://github.com/microsoft/FluidFramework/compare/main...markfields:FluidFramework:sweeptimeout-shortbuffer
  • gc-sweep-timeout-testoverrides on my codespace (couldn't push at the moment due to Codespace problem)

The specific plan I have in mind lately:

  • priority is to get the value persisted to the file. This simplifies interop with future changes in test override logic - that logic only applies to creation, and beyond that all code is the same.
  • SessionExpiry is already persisted, snapshotExpiry has to be persisted per the design we finalized this week, so we will also persist buffer.
  • As for new documents, to keep minimal code change at first until we can try it out more, leave SessionExpiry as-is (via options), plumb through snapshotCacheExpiry from driver (per the design doc), and then set buffer to 1ms if snapshotExpiry is 0. This minimizes localStorage overrides needed.
  • we can iterate on logic for creating new test documents freely, just a simple starting place.

markfields avatar Oct 07 '22 03:10 markfields

Replaced by #12331

markfields avatar Oct 07 '22 14:10 markfields