Skip to content

Commit 07f2fe8

Browse files
committed
Fixtures test for initialization repeatedly
1 parent de78621 commit 07f2fe8

File tree

16 files changed

+50
-7
lines changed

16 files changed

+50
-7
lines changed

fixtures/basic/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"devDependencies": {
1111
"chai": "^6.2.0",
1212
"mocha": "^11.7.4",
13+
"retry": "file:../retry",
1314
"ts-mocha": "^10.0.0",
1415
"@types/bn.js": "^5.2.0",
1516
"@types/chai": "^5.2.2",

fixtures/basic/tests/basic.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as anchor from "@coral-xyz/anchor";
22
import { Program } from "@coral-xyz/anchor";
33
import { PublicKey } from "@solana/web3.js";
4+
import { retry } from "retry";
45
import { Basic } from "../target/types/basic";
56
import * as assert from "assert";
67

@@ -17,7 +18,7 @@ describe("basic", () => {
1718

1819
it("Is initialized!", async () => {
1920
// Add your test here.
20-
const tx = await program.methods.initialize().rpc();
21+
const tx = await retry(() => program.methods.initialize().rpc());
2122
console.log("Your transaction signature", tx);
2223
});
2324

fixtures/basic/yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ require-directory@^2.1.1:
766766
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
767767
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
768768

769+
"retry@file:../retry":
770+
version "0.0.0"
771+
769772
rpc-websockets@^9.0.2:
770773
version "9.1.1"
771774
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.1.1.tgz#5764336f3623ee1c5cc8653b7335183e3c0c78bd"

fixtures/external_call/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"devDependencies": {
1111
"chai": "^6.2.0",
1212
"mocha": "^11.7.4",
13+
"retry": "file:../retry",
1314
"ts-mocha": "^10.0.0",
1415
"@types/bn.js": "^5.2.0",
1516
"@types/chai": "^5.2.2",

fixtures/external_call/tests/external_call.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as anchor from "@coral-xyz/anchor";
22
import { Program } from "@coral-xyz/anchor";
3+
import { retry } from "retry";
34
import { ExternalCall } from "../target/types/external_call";
45

56
describe("external_call", () => {
@@ -10,7 +11,7 @@ describe("external_call", () => {
1011

1112
it("Is initialized!", async () => {
1213
// Add your test here.
13-
const tx = await program.methods.initialize().rpc();
14+
const tx = await retry(() => program.methods.initialize().rpc());
1415
console.log("Your transaction signature", tx);
1516
let txDetails = null;
1617
let nAttempts = 0;

fixtures/external_call/yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ require-directory@^2.1.1:
766766
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
767767
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
768768

769+
"retry@file:../retry":
770+
version "0.0.0"
771+
769772
rpc-websockets@^9.0.2:
770773
version "9.1.1"
771774
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.1.1.tgz#5764336f3623ee1c5cc8653b7335183e3c0c78bd"

fixtures/multiple_programs/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"devDependencies": {
1111
"chai": "^6.2.0",
1212
"mocha": "^11.7.4",
13+
"retry": "file:../retry",
1314
"ts-mocha": "^10.0.0",
1415
"@types/bn.js": "^5.2.0",
1516
"@types/chai": "^5.2.2",

fixtures/multiple_programs/tests/bar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as anchor from "@coral-xyz/anchor";
22
import { Program } from "@coral-xyz/anchor";
33
import { PublicKey } from "@solana/web3.js";
4+
import { retry } from "retry";
45
import { Bar } from "../target/types/bar";
56
import * as assert from "assert";
67

@@ -17,7 +18,7 @@ describe("bar", () => {
1718

1819
it("Is initialized!", async () => {
1920
// Add your test here.
20-
const tx = await program.methods.initialize().rpc();
21+
const tx = await retry(() => program.methods.initialize().rpc());
2122
console.log("Your transaction signature", tx);
2223
});
2324

fixtures/multiple_programs/tests/foo.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as anchor from "@coral-xyz/anchor";
22
import { Program } from "@coral-xyz/anchor";
33
import { PublicKey } from "@solana/web3.js";
4+
import { retry } from "retry";
45
import { Foo } from "../target/types/foo";
56
import * as assert from "assert";
67

@@ -17,7 +18,7 @@ describe("foo", () => {
1718

1819
it("Is initialized!", async () => {
1920
// Add your test here.
20-
const tx = await program.methods.initialize().rpc();
21+
const tx = await retry(() => program.methods.initialize().rpc());
2122
console.log("Your transaction signature", tx);
2223
});
2324

fixtures/multiple_programs/yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ require-directory@^2.1.1:
766766
resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
767767
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
768768

769+
"retry@file:../retry":
770+
version "0.0.0"
771+
769772
rpc-websockets@^9.0.2:
770773
version "9.1.1"
771774
resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-9.1.1.tgz#5764336f3623ee1c5cc8653b7335183e3c0c78bd"

0 commit comments

Comments
 (0)