Skip to content

Commit e5bf092

Browse files
committed
try fixes
1 parent c32564c commit e5bf092

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed

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

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ describe('Migration from gateway test', function () {
187187
tryCount += 1;
188188
await utils.sleep(1);
189189
}
190-
console.error('tryCount', tryCount);
191190
});
192191

193192
step('Migrate to/from gateway', async () => {
@@ -199,32 +198,10 @@ describe('Migration from gateway test', function () {
199198
// Trying to send a transaction from the same address again
200199
await checkedRandomTransfer(alice, 1n);
201200

202-
// Theoretically, if L1 is really slow at this part, it could lead to a situation
203-
// where there is an inflight transaction before the migration is complete.
204-
// If you encounter an error, such as a failed transaction, after the migration,
205-
// this area might be worth revisiting to wait for unconfirmed transactions on the server.
206-
await utils.sleep(30);
207-
208-
// Wait for all batches to be executed
209-
await waitForAllBatchesToBeExecuted();
210-
211201
if (direction == 'TO') {
212-
const maxRetries = 3;
213-
for (let i = 0; i < maxRetries; i++) {
214-
try {
215-
// We use utils.exec instead of utils.spawn to capture stdout/stderr
216-
await utils.exec(
217-
`zkstack chain gateway migrate-to-gateway --chain ${fileConfig.chain} --gateway-chain-name ${gatewayChain}`
218-
);
219-
break;
220-
} catch (error) {
221-
if (i === maxRetries - 1) {
222-
console.error(`Gateway migration failed after ${maxRetries} attempts.`);
223-
throw error;
224-
}
225-
console.log(`Gateway migration failed (attempt ${i + 1}/${maxRetries}). Retrying...`);
226-
}
227-
}
202+
await utils.spawn(
203+
`zkstack chain gateway migrate-to-gateway --chain ${fileConfig.chain} --gateway-chain-name ${gatewayChain}`
204+
);
228205
} else {
229206
let migrationSucceeded = false;
230207
for (let i = 0; i < 60; i++) {
@@ -269,7 +246,6 @@ describe('Migration from gateway test', function () {
269246
});
270247

271248
step('Wait for block finalization', async () => {
272-
await utils.spawn(`zkstack server wait --ignore-prerequisites --verbose --chain ${fileConfig.chain}`);
273249
// Execute an L2 transaction
274250
const txHandle = await checkedRandomTransfer(alice, 1n);
275251
await txHandle.waitFinalize();

0 commit comments

Comments
 (0)