Skip to content

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

Merged
pjcdawkins merged 1 commit into
mainfrom
fix-flaky-test
Mar 11, 2026
Merged

fix(legacy): resolve flaky TestApiCurlCommand by fixing 401 detection race condition#21
pjcdawkins merged 1 commit into
mainfrom
fix-flaky-test

Conversation

@romainneutron

Copy link
Copy Markdown
Contributor

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
@pjcdawkins
pjcdawkins merged commit 6bbd41c into main Mar 11, 2026
4 of 5 checks passed
@pjcdawkins
pjcdawkins deleted the fix-flaky-test branch March 11, 2026 12:35
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