Skip to content

Commit 8d061ac

Browse files
committed
Add post-snapshot read grace period in unit tests for DeepnoteFileChangeWatcher to ensure proper handling of snapshot reads
1 parent c74ffa7 commit 8d061ac

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/notebooks/deepnote/deepnoteFileChangeWatcher.unit.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const waitForIntervalMs = 50;
3232
const debounceWaitMs = 800;
3333
const rapidChangeIntervalMs = 100;
3434
const autoSaveGraceMs = 200;
35+
const postSnapshotReadGraceMs = 100;
3536

3637
/**
3738
* Polls until a condition is met or a timeout is reached.
@@ -1130,6 +1131,7 @@ project:
11301131
noFallbackOnDidChange.fire(snapshotUri);
11311132

11321133
await waitFor(() => nfReadSnapshotCount >= 1);
1134+
await new Promise((resolve) => setTimeout(resolve, postSnapshotReadGraceMs));
11331135

11341136
assert.isAtLeast(nfReadSnapshotCount, 1, 'readSnapshot should be called');
11351137
assert.strictEqual(nfApplyEditCount, 0, 'applyEdit should NOT be called when no block IDs can be resolved');

0 commit comments

Comments
 (0)