Skip to content

Commit a9b1ce2

Browse files
committed
try wait until pq empty
1 parent 0e42b36 commit a9b1ce2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

core/tests/gateway-migration-test/tests/migration.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ describe('Migration From/To gateway test', function () {
138138
tryCount += 1;
139139
await utils.sleep(1);
140140
}
141+
142+
// Additionally wait until the priority queue is empty if we are migrating to gateway
143+
if (direction == 'TO') {
144+
let priorityQueueSize = await l1MainContract.getPriorityQueueSize();
145+
let tryCount = 0;
146+
while (priorityQueueSize > 0 && tryCount < 30) {
147+
priorityQueueSize = await l1MainContract.getPriorityQueueSize();
148+
tryCount += 1;
149+
await utils.sleep(1);
150+
}
151+
}
141152
});
142153

143154
step('Migrate to/from gateway', async () => {

0 commit comments

Comments
 (0)