Skip to content

Commit

Permalink
test(serviceConfig): squash flake, reduce polling interval
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Oct 25, 2024
1 parent e879427 commit 347141b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ exports[`ServiceConfig should handle polling service call errors: status error p
"config": undefined,
"url": "/pollError",
},
"pollInterval": 1,
"pollInterval": 0,
"status": [Function],
"validate": [Function],
},
Expand Down Expand Up @@ -415,7 +415,7 @@ exports[`ServiceConfig should handle polling service call errors: status of a st
"config": undefined,
"url": "/pollError",
},
"pollInterval": 1,
"pollInterval": 0,
"status": [Function],
"validate": [Function],
},
Expand Down Expand Up @@ -465,7 +465,7 @@ exports[`ServiceConfig should handle polling service calls: basic polling valida
"config": undefined,
"url": "/test/",
},
"pollInterval": 1,
"pollInterval": 0,
"validate": [Function],
},
},
Expand Down Expand Up @@ -519,7 +519,7 @@ exports[`ServiceConfig should handle polling service calls: custom location 1`]
"pollConfig": {
"__retryCount": 0,
"location": [Function],
"pollInterval": 1,
"pollInterval": 0,
"validate": [Function],
},
"url": "/pollSuccess/",
Expand Down Expand Up @@ -576,7 +576,7 @@ exports[`ServiceConfig should handle polling service calls: specific polling val
"config": undefined,
"url": "/test/",
},
"pollInterval": 1,
"pollInterval": 0,
"validate": [Function],
},
},
Expand Down Expand Up @@ -629,7 +629,7 @@ exports[`ServiceConfig should handle polling service calls: status polling 1`] =
"config": undefined,
"url": "/test/",
},
"pollInterval": 1,
"pollInterval": 0,
"status": [Function],
"validate": [Function],
},
Expand Down
18 changes: 9 additions & 9 deletions src/services/common/__tests__/serviceConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ describe('ServiceConfig', () => {
return count === 1;
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

expect(basicPollValidator).toHaveBeenCalledTimes(3);
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('ServiceConfig', () => {
}
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

expect(specificPollValidator).toHaveBeenCalledTimes(3);
Expand Down Expand Up @@ -323,7 +323,7 @@ describe('ServiceConfig', () => {
status: (...args) => statusPoll(...args)
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

// delay to give the internal status promise time to unwrap
Expand Down Expand Up @@ -358,7 +358,7 @@ describe('ServiceConfig', () => {
validate: (response, count) => count === 2
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

expect(mockLocation).toHaveBeenCalledTimes(3);
Expand Down Expand Up @@ -389,7 +389,7 @@ describe('ServiceConfig', () => {
throw new Error('basic validation error');
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);
expect(consoleSpyError.mock.calls).toMatchSnapshot('validation error');
consoleSpyError.mockClear();
Expand All @@ -405,7 +405,7 @@ describe('ServiceConfig', () => {
}
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

// delay to give the internal status promise time to unwrap
Expand All @@ -427,7 +427,7 @@ describe('ServiceConfig', () => {
status: (...args) => statusErrorPoll(...args)
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

// delay to give the internal status promise time to unwrap
Expand Down Expand Up @@ -458,7 +458,7 @@ describe('ServiceConfig', () => {
}
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

// delay to give the internal status promise time to unwrap
Expand All @@ -483,7 +483,7 @@ describe('ServiceConfig', () => {
}
}
},
{ pollInterval: 1 }
{ pollInterval: 0 }
);

// delay to give the internal status promise time to unwrap
Expand Down

0 comments on commit 347141b

Please sign in to comment.