diff --git a/tests/auction-house/tests/auction-house.ts b/tests/auction-house/tests/auction-house.ts index 220ae7faa2..51fa015a4e 100644 --- a/tests/auction-house/tests/auction-house.ts +++ b/tests/auction-house/tests/auction-house.ts @@ -112,7 +112,10 @@ describe("auction-house", () => { mintAuthority: authority, } ); - await getProvider().sendAndConfirm(tx); + await getProvider().sendAndConfirm(tx, [], { + maxRetries: 3, + skipPreflight: true, + }); }); it("Creates token accounts for the NFT", async () => { @@ -184,7 +187,10 @@ describe("auction-house", () => { lamports: 100 * 10 ** 9, }) ); - const txSig = await getProvider().sendAndConfirm(tx); + const txSig = await getProvider().sendAndConfirm(tx, [], { + maxRetries: 3, + skipPreflight: true, + }); console.log("fund buyer:", txSig); }); @@ -421,7 +427,10 @@ describe("auction-house", () => { .instruction() ); - const txSig = await authorityClient.provider.sendAndConfirm(tx); + const txSig = await authorityClient.provider.sendAndConfirm(tx, [], { + maxRetries: 3, + skipPreflight: true, + }); console.log("updateAuctionHouse:", txSig); const newAh = await authorityClient.account.auctionHouse.fetch( diff --git a/tests/bench/tests/compute-units.ts b/tests/bench/tests/compute-units.ts index 2a964fdaef..222387e408 100644 --- a/tests/bench/tests/compute-units.ts +++ b/tests/bench/tests/compute-units.ts @@ -141,7 +141,10 @@ describe("Compute units", () => { .instruction(); tx.add(createTokenIx, initTokenIx); - await tokenProgram.provider.sendAndConfirm!(tx, [mintKp, tokenKp]); + await tokenProgram.provider.sendAndConfirm!(tx, [mintKp, tokenKp], { + maxRetries: 3, + skipPreflight: true, + }); }); it("AccountInfo", async () => { diff --git a/tests/cpi-returns/tests/cpi-return.ts b/tests/cpi-returns/tests/cpi-return.ts index 0099ef45a2..75c608e599 100644 --- a/tests/cpi-returns/tests/cpi-return.ts +++ b/tests/cpi-returns/tests/cpi-return.ts @@ -28,7 +28,12 @@ describe("CPI return", () => { const cpiReturn = anchor.web3.Keypair.generate(); - const confirmOptions: ConfirmOptions = { commitment: "confirmed" }; + const confirmOptions: ConfirmOptions = { + commitment: "confirmed", + preflightCommitment: "confirmed", + skipPreflight: true, + maxRetries: 3, + }; it("can initialize", async () => { await calleeProgram.methods diff --git a/tests/custom-discriminator/tests/custom-discriminator.ts b/tests/custom-discriminator/tests/custom-discriminator.ts index b87e20594a..e402d46de7 100644 --- a/tests/custom-discriminator/tests/custom-discriminator.ts +++ b/tests/custom-discriminator/tests/custom-discriminator.ts @@ -19,7 +19,10 @@ describe("custom-discriminator", () => { assert(data.equals(Buffer.from(ix.discriminator))); // Verify tx runs - await program.provider.sendAndConfirm!(tx); + await program.provider.sendAndConfirm!(tx, [], { + maxRetries: 3, + skipPreflight: true, + }); }; it("Integer", () => testCommon("int")); diff --git a/tests/errors/tests/errors.ts b/tests/errors/tests/errors.ts index 09df19e7e0..e8f322a55b 100644 --- a/tests/errors/tests/errors.ts +++ b/tests/errors/tests/errors.ts @@ -46,6 +46,7 @@ describe("errors", () => { // because we cannot get logs for them (only through overkill `onLogs`) provider.opts.commitment = "confirmed"; anchor.setProvider(provider); + provider.opts.maxRetries = 3; const program = anchor.workspace.Errors as Program; diff --git a/tests/events/tests/events.ts b/tests/events/tests/events.ts index 7cd2333a78..5cd4d43ac2 100644 --- a/tests/events/tests/events.ts +++ b/tests/events/tests/events.ts @@ -46,9 +46,15 @@ describe("Events", () => { }); describe("CPI event", () => { + const config = { + commitment: "confirmed", + preflightCommitment: "confirmed", + skipPreflight: true, + maxRetries: 3, + } as const; + it("Works without accounts being specified", async () => { const tx = await program.methods.testEventCpi().transaction(); - const config = { commitment: "confirmed" } as const; const txHash = await program.provider.sendAndConfirm(tx, [], config); const txResult = await program.provider.connection.getTransaction( txHash, @@ -91,7 +97,7 @@ describe("Events", () => { ); try { - await program.provider.sendAndConfirm(tx, []); + await program.provider.sendAndConfirm(tx, [], config); } catch (e) { if (e.logs.some((log) => log.includes("ConstraintSigner"))) return; console.log(e); diff --git a/tests/spl/transfer-hook/tests/transfer-hook.ts b/tests/spl/transfer-hook/tests/transfer-hook.ts index 249cded332..e3ad29234f 100644 --- a/tests/spl/transfer-hook/tests/transfer-hook.ts +++ b/tests/spl/transfer-hook/tests/transfer-hook.ts @@ -136,11 +136,12 @@ describe("transfer hook", () => { "confirmed" ); - await sendAndConfirmTransaction(provider.connection, transaction, [ - payer, - mint, - mintAuthority, - ]); + await sendAndConfirmTransaction( + provider.connection, + transaction, + [payer, mint, mintAuthority], + { maxRetries: 3, skipPreflight: true } + ); }); it("can create an `InitializeExtraAccountMetaList` instruction with the proper discriminator", async () => { @@ -275,7 +276,8 @@ describe("transfer hook", () => { await sendAndConfirmTransaction( provider.connection, new Transaction().add(ix), - [payer, sourceAuthority] + [payer, sourceAuthority], + { maxRetries: 3, skipPreflight: true } ); // Check the resulting token balances