Skip to content

Commit

Permalink
fix: Flakey test (#17649)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjackwhite authored Sep 28, 2023
1 parent 3e13484 commit 3675bf4
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,6 @@ describe('ingester', () => {

it("flushes and commits as it's revoked", async () => {
await ingester.handleEachBatch([createMessage('sid1'), createMessage('sid2'), createMessage('sid3', 2)])
const revokePromise = ingester.onRevokePartitions([createTP(1)])

expect(Object.keys(ingester.sessions)).toEqual([`${team.id}-sid3`])

expect(readdirSync(config.SESSION_RECORDING_LOCAL_DIRECTORY + '/session-buffer-files')).toEqual([
expect.stringContaining(`${team.id}.sid1.`), // gz
Expand All @@ -509,6 +506,10 @@ describe('ingester', () => {
expect.stringContaining(`${team.id}.sid3.`), // json
])

const revokePromise = ingester.onRevokePartitions([createTP(1)])

expect(Object.keys(ingester.sessions)).toEqual([`${team.id}-sid3`])

await revokePromise

// Only files left on the system should be the sid3 ones
Expand Down

0 comments on commit 3675bf4

Please sign in to comment.