Skip to content

Commit b972178

Browse files
huydhnCamyll
authored andcommitted
Correctly return 200 in api/flaky-tests/disable (#6184)
When investigating pytorch/pytorch#144964, I notice that `api/flaky-tests/disable` returns 403 error code even when I use the correct credential. Same goes on https://vercel.com/fbopensource/torchci/logs?requestPaths=%2Fapi%2Fflaky-tests%2Fdisable&selectedLogId=cv6z2-1736966788286-ab32c5324f42&timeline=maximum&page=2
1 parent abf8016 commit b972178

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

torchci/pages/api/flaky-tests/disable.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ export default async function handler(
2929
if (authorization === process.env.FLAKY_TEST_BOT_KEY) {
3030
await disableFlakyTestsAndReenableNonFlakyTests();
3131
res.status(200).end();
32+
} else {
33+
res.status(403).end();
3234
}
33-
res.status(403).end();
3435
}
3536

3637
async function disableFlakyTestsAndReenableNonFlakyTests() {

0 commit comments

Comments
 (0)