Skip to content

Commit 0708789

Browse files
committed
Updates to give a grace period before running
1 parent 0cf5181 commit 0708789

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.github/actions/fix/src/retry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function sleep(ms: number): Promise<void> {
1616
*/
1717
export async function retry<T>(
1818
fn: () => Promise<T | null | undefined> | T | null | undefined,
19-
maxAttempts = 10,
19+
maxAttempts = 6,
2020
baseDelay = 2000,
2121
attempt = 1,
2222
): Promise<T | undefined> {

tests/site-with-errors.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const OctokitWithThrottling = Octokit.plugin(throttling)
88

99
describe('site-with-errors', () => {
1010
let results: Result[]
11+
const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms))
1112

1213
beforeAll(() => {
1314
expect(process.env.CACHE_PATH).toBeDefined()
@@ -145,6 +146,8 @@ describe('site-with-errors', () => {
145146
// Fetch pull requests referenced in the findings file
146147
pullRequests = await Promise.all(
147148
results.map(async ({pullRequest: {url: pullRequestUrl}}) => {
149+
// Give linked Copilot PR creation a short grace period before asserting.
150+
await wait(3000)
148151
expect(pullRequestUrl).toBeDefined()
149152
const {owner, repo, pullNumber} =
150153
/https:\/\/github\.com\/(?<owner>[^/]+)\/(?<repo>[^/]+)\/pull\/(?<pullNumber>\d+)/.exec(

0 commit comments

Comments
 (0)