Skip to content

fix(legacy): resolve flaky TestApiCurlCommand by fixing 401 detection race condition#21

Open
romainneutron wants to merge 1 commit intomainfrom
fix-flaky-test
Open

fix(legacy): resolve flaky TestApiCurlCommand by fixing 401 detection race condition#21
romainneutron wants to merge 1 commit intomainfrom
fix-flaky-test

Conversation

@romainneutron
Copy link

The api:curl 401 retry mechanism parsed curl's verbose stderr in individual chunks via a Process callback. With --fail-with-body (default), curl exits quickly with code 22 on 4xx, and the stderr chunk containing the HTTP status line could be missed due to chunk boundary splits or process exit timing.

Accumulate all stderr during process execution and check the full buffer for 401 after the process completes, eliminating the race condition.

… race condition

The api:curl 401 retry mechanism parsed curl's verbose stderr in individual
chunks via a Process callback. With --fail-with-body (default), curl exits
quickly with code 22 on 4xx, and the stderr chunk containing the HTTP status
line could be missed due to chunk boundary splits or process exit timing.

Accumulate all stderr during process execution and check the full buffer for
401 after the process completes, eliminating the race condition.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@romainneutron romainneutron marked this pull request as ready for review February 24, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants