Skip to content

test(integration): fix flaky test_delete_network batch race - #399

Merged
TKIPisalegacycipher merged 1 commit into
mainfrom
fix/flaky-delete-network-batch
Jun 10, 2026
Merged

test(integration): fix flaky test_delete_network batch race#399
TKIPisalegacycipher merged 1 commit into
mainfrom
fix/flaky-delete-network-batch

Conversation

@TKIPisalegacycipher

Copy link
Copy Markdown
Collaborator

Problem

test_delete_network has flaked on three recent dependabot PRs (#393, #394, #395) with:

createOrganizationActionBatch - 400 Bad Request, {'errors': ['Network with ID ... not found']}

Root cause

The test retries createOrganizationActionBatch up to 5 times. Action batches are asynchronous/eventually-consistent: a prior attempt's batch can finish deleting the network after the test stops polling its status. The next attempt then references a network that's already gone → 400 "not found".

The network fixture has no teardown, so this test is the sole deleter — the only way the network can be absent on attempt N>1 is that attempt N-1 already deleted it.

Fix

A delete is idempotent. A 400 not-found on the create call means the network is already gone, which is the desired end state → return success. Applied to both sync and async lifecycle tests.

🤖 Generated with Claude Code

test_delete_network retries createOrganizationActionBatch up to 5 times,
but action batches are asynchronous: a prior attempt's batch can finish
deleting the network after the test stops polling. The next attempt then
hits 400 "Network not found", flaking the suite (#393, #394, #395).

A delete is idempotent, so a 400 not-found on the create call means the
network is already gone, which is the desired end state. Catch it and
return success in both the sync and async lifecycle tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@TKIPisalegacycipher
TKIPisalegacycipher merged commit a463cb1 into main Jun 10, 2026
12 checks passed
@TKIPisalegacycipher
TKIPisalegacycipher deleted the fix/flaky-delete-network-batch branch June 10, 2026 20:06
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.

1 participant