Skip to content

Commit

Permalink
test(e2e): fix flaky projection test
Browse files Browse the repository at this point in the history
it was sometimes skipping a block that changes # of keys
  • Loading branch information
mkazlauskas committed Mar 21, 2023
1 parent bbf41ee commit 51b56d0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/e2e/test/projection/offline-fork.test.ts
Expand Up @@ -139,7 +139,13 @@ describe('resuming projection when intersection is not local tip', () => {
const continue$ = project(ogmiosCardanoNode, sinksFactory).pipe(share());
const rollForward$ = continue$.pipe(filter((evt) => evt.eventType === ChainSyncEventType.RollForward));
const rolledBackKeyRegistrations$ = continue$.pipe(
filter((evt) => evt.eventType === ChainSyncEventType.RollBackward && evt.stakeKeys.del.length > 0)
filter(
(evt) =>
evt.eventType === ChainSyncEventType.RollBackward &&
// Test was flaky when checking only `del.length`,
// because then it could be skipping some events that affect total # of stake pools
(evt.stakeKeys.del.length > 0 || evt.stakeKeys.insert.length > 0)
)
);
await Promise.all([
firstValueFrom(continue$).then((firstEvent) => {
Expand Down

0 comments on commit 51b56d0

Please sign in to comment.