Test: pin idempotent-POST 503→success retry through the service API
Summary
Positive per-SDK unit coverage for the hole #439 / #417 addressed: an idempotent-flagged POST (CompleteTodo) must retry on a transient 503 and succeed. Test-only; no SDK source change. PR2 of a three-PR series (PR1 → PR2 → PR3); independent of PR1.
Each test drives the generated account/service path (todos.complete → CompleteTodo), not the raw HTTP client, so it fails if CompleteTodo's metadata idempotency classification is ever flipped off — the per-SDK analog of Swift's testGeneratedIdempotentPostRetries.
Five tests
| SDK | Why it's needed |
|---|---|
Kotlin (RetryTest) | The existing retryForIdempotentOperationWithMetadata drives PUT/UpdateProject, retried via the method allowlist (method in IDEMPOTENT_METHODS) — it never exercises the POST metadata gate. This one does, via account.todos.complete. |
Go (todos_test) | httptest attempt-counting through Todos().Complete. In Go the load-bearing value is the generated call-site boolean doWithRetry(…, true, "CompleteTodo", …), so this guards that gate. |
TypeScript (todos.test) | The suite defaults enableRetry:false, so the new test instantiates a retry-enabled client and drives client.todos.complete. |
Python (test_todos) | Sync and async clients have separate retry loops (_http.py vs _async_http.py), so both are covered (two tests). Fast retry config (base_delay=0) keeps them instant. |
Verification
- All 5 tests pass (TS, Go, Kotlin, Python-sync, Python-async).
- Each verified to fail when its SDK's
CompleteTodoidempotent flag is flipped off (Kotlin/Python/TS metadata; Go call-site boolean) — proving they guard the metadata/classification gate, not incidental behavior.
Summary by cubic
Add cross-SDK tests to ensure the idempotent POST CompleteTodo retries on a 503 and succeeds when called via todos.complete.
Covers Kotlin (now also asserts POST and /todos/{id}/completion.json path), Go, TypeScript (explicit enableRetry: true), and Python (sync + async); each fails if CompleteTodo’s idempotent flag is removed; test-only, no SDK source changes; refs #439, #417.