Skip to content

Isolate InvokerMemoryTest cases via @AfterEach cleanup#413

Merged
tillrohrmann merged 1 commit into
restatedev:mainfrom
tillrohrmann:harden-invoker-memory-tests
May 4, 2026
Merged

Isolate InvokerMemoryTest cases via @AfterEach cleanup#413
tillrohrmann merged 1 commit into
restatedev:mainfrom
tillrohrmann:harden-invoker-memory-tests

Conversation

@tillrohrmann
Copy link
Copy Markdown
Contributor

Tests in InvokerMemoryTest share a single deployment via the companion- scoped @RegisterExtension, and the extension only implements BeforeAllCallback. When a test failed or timed out, its in-flight invocations kept running on the cluster and held the global memory pool full, cascading into every subsequent test in the class.

Add an @AfterEach that lists pending (status != 'completed') invocations, kills each, and waits for the invoker memory pool to drain to zero. The list+kill+assert step runs inside a single awaitility untilAsserted block, so transient admin-API failures (e.g. 503 during leadership changes, 404 from invocations that finished between query and kill) are absorbed by the existing ignoreExceptions() in utils.kt's untilAsserted wrapper.

Tests in InvokerMemoryTest share a single deployment via the companion-
scoped @RegisterExtension, and the extension only implements
BeforeAllCallback. When a test failed or timed out, its in-flight
invocations kept running on the cluster and held the global memory pool
full, cascading into every subsequent test in the class.

Add an @AfterEach that lists pending (status != 'completed') invocations,
kills each, and waits for the invoker memory pool to drain to zero. The
list+kill+assert step runs inside a single awaitility untilAsserted block,
so transient admin-API failures (e.g. 503 during leadership changes,
404 from invocations that finished between query and kill) are absorbed
by the existing ignoreExceptions() in utils.kt's untilAsserted wrapper.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tillrohrmann tillrohrmann merged commit 96bda5c into restatedev:main May 4, 2026
3 checks passed
@tillrohrmann tillrohrmann deleted the harden-invoker-memory-tests branch May 4, 2026 12:55
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants