Skip to content

Commit

Permalink
test(operate): document the delay and eventual consistency measure in…
Browse files Browse the repository at this point in the history
… test
  • Loading branch information
jwulf committed Apr 19, 2024
1 parent 0b0d6e8 commit 0093a3a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/__tests__/operate/operate-integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ test('getJSONVariablesforProcess works', async () => {
},
})

// Wait for Operate to catch up.
await new Promise((res) => setTimeout(() => res(null), 7000))

// Make sure that the process instance exists in Operate.
const process = await c.getProcessInstance(p.processInstanceKey)
// If this fails, it is probably a timing issue.
// Operate is eventually consistent, so we need to wait a bit.
expect(process.key).toBe(p.processInstanceKey)
const res = await c.getJSONVariablesforProcess(p.processInstanceKey)
expect(res.foo).toBe('bar')
})
Expand Down

0 comments on commit 0093a3a

Please sign in to comment.