Added retry logic to provider tests.

This commit is contained in:
Richard Moore 2020-09-04 02:06:04 -04:00
parent a440317594
commit 0558bba8eb
No known key found for this signature in database
GPG Key ID: 665176BE8E9DC651

@ -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;
@ -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 = {
@ -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();
}
@ -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;