Skip to content

Commit d8d518f

Browse files
committed
tests: Fix timeout series generation for fake benchmark
Signed-off-by: Marcel Klehr <[email protected]>
1 parent 1e24442 commit d8d518f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6918,10 +6918,10 @@ describe('Floccus', function() {
69186918
if (!timeouts.length) {
69196919
timeouts = new Array(1000).fill(0).map((_, index) =>
69206920
ACCOUNT_DATA.type === 'nextcloud-bookmarks'
6921-
// Produce random numbers of timeouts between 30s and increasing numbers between 30s and 180s (increasing for streches of 20, then going back to 30s)
6921+
// Produce random numbers of timeouts between 30s and increasing numbers between 30s and 180s (increasing for stretches of 20 items, then going back to 30s)
69226922
? random.int(30000, Math.round(30000 + (180000 - 30000) * (index % 20) / 20))
6923-
// Produce random numbers of timeouts between 4s and increasing numbers between 4s and 20s (increasing for streches of 20, then going back to 4s)
6924-
: random.int(200, Math.round(4000 + (20000 - 4000) * (index % 20) / 20))
6923+
// Produce random numbers of timeouts between 4s and increasing numbers between 4s and 20s (increasing for stretches of 20 items, then going back to 4s)
6924+
: random.int(4000, Math.round(4000 + (20000 - 4000) * (index % 20) / 20))
69256925
)
69266926
}
69276927
const timeout = timeouts[(i++) % 1000]
@@ -8140,12 +8140,12 @@ describe('Floccus', function() {
81408140
it('should handle fuzzed changes with deletions from two clients with interrupts (no caching adapter)', async function() {
81418141
// Wire both accounts to the same fake db
81428142
// We set the cache properties to the same object, because we want to simulate nextcloud-bookmarks
8143-
account1.server.bookmarksCache = account2.server.bookmarksCache = new Folder(
8143+
const bmDb = account1.server.bookmarksCache = account2.server.bookmarksCache = new Folder(
81448144
{ id: '', title: 'root', location: 'Server' }
81458145
)
8146-
account1.server.onSyncStart = null
8146+
account1.server.onSyncStart = function() { this.bookmarksCache = bmDb }
81478147
account1.server.onSyncComplete = null
8148-
account2.server.onSyncStart = null
8148+
account2.server.onSyncStart = function() { this.bookmarksCache = bmDb }
81498149
account2.server.onSyncComplete = null
81508150
await interruptBenchmark()
81518151
})

0 commit comments

Comments
 (0)