Skip to content

Commit

Permalink
Added retry logic to provider tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo committed Sep 4, 2020
1 parent a440317 commit 0558bba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/tests/src.ts/test-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ function testProvider(providerName: string, networkName: string) {
const delay = 1000;

describe(("Read-Only " + providerName + " (" + networkName + ")"), function() {
this.retries(3);

// Get the Provider based on the name of the provider we are testing and the network
let provider: ethers.providers.Provider = null;
Expand Down Expand Up @@ -615,6 +616,8 @@ describe("Test extra Etherscan operations", function() {
*/

describe("Test Basic Authentication", function() {
this.retries(3);

// https://stackoverflow.com/questions/6509278/authentication-test-servers#16756383

type TestCase = {
Expand Down Expand Up @@ -738,6 +741,8 @@ describe("Test API Key Formatting", function() {
});

describe("Test WebSocketProvider", function() {
this.retries(3);

async function testWebSocketProvider(provider: ethers.providers.WebSocketProvider): Promise<void> {
await provider.destroy();
}
Expand All @@ -749,6 +754,8 @@ describe("Test WebSocketProvider", function() {
});

describe("Test Events", function() {
this.retries(3);

async function testBlockEvent(provider: ethers.providers.Provider) {
return new Promise((resolve, reject) => {
let firstBlockNumber: number = null;
Expand Down

0 comments on commit 0558bba

Please sign in to comment.