Test: pin idempotent-POST 503→success retry through the service API

Merged
JE
4mo ago
+143-1

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

SDKWhy 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 CompleteTodo idempotent flag is flipped off (Kotlin/Python/TS metadata; Go call-site boolean) — proving they guard the metadata/classification gate, not incidental behavior.

Refs #439, #417.


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.