1
0
Fork 0
mirror of synced 2024-09-20 19:33:10 +12:00

Fix a flake in the redis.spec.ts file.

This commit is contained in:
Sam Rose 2024-07-11 13:58:28 +01:00
parent 5f0597deef
commit d530909c3b
No known key found for this signature in database

View file

@ -2,6 +2,7 @@ import { GenericContainer, StartedTestContainer } from "testcontainers"
import { generator, structures } from "../../../tests" import { generator, structures } from "../../../tests"
import RedisWrapper from "../redis" import RedisWrapper from "../redis"
import { env } from "../.." import { env } from "../.."
import { randomUUID } from "crypto"
jest.setTimeout(30000) jest.setTimeout(30000)
@ -52,10 +53,10 @@ describe("redis", () => {
describe("bulkStore", () => { describe("bulkStore", () => {
function createRandomObject( function createRandomObject(
keyLength: number, keyLength: number,
valueGenerator: () => any = () => generator.word() valueGenerator: () => any = () => randomUUID()
) { ) {
return generator return generator
.unique(() => generator.word(), keyLength) .unique(() => randomUUID(), keyLength)
.reduce((acc, key) => { .reduce((acc, key) => {
acc[key] = valueGenerator() acc[key] = valueGenerator()
return acc return acc