Skip to content

refactor: move wait helper from Operations to test utils#74

Open
yashhzd wants to merge 1 commit intocardano-foundation:mainfrom
yashhzd:refactor/move-wait-to-test-utils
Open

refactor: move wait helper from Operations to test utils#74
yashhzd wants to merge 1 commit intocardano-foundation:mainfrom
yashhzd:refactor/move-wait-to-test-utils

Conversation

@yashhzd
Copy link

@yashhzd yashhzd commented Feb 14, 2026

Closes #50

Summary

The wait() polling logic, WaitOptions, and AbortSignal have been moved out of the production Operations class into a new OperationWaiter test utility. This ensures library consumers are not coupled to a specific polling strategy and can implement their own.

Changes

  • Operations.java — Removed wait() (3 overloads), WaitOptions, and AbortSignal. The public API now exposes only get(), list(), and delete().
  • OperationWaiter.java (new) — Test utility in e2e.utils containing the extracted wait/polling logic with exponential backoff, dependent operation handling, and abort signal support.
  • TestUtils.java — Updated waitOperation() to delegate to OperationWaiter.wait().
  • MultisigTest.java — Updated waitOperations() to use OperationWaiter.wait().
  • OperationWaiterTest.java (new) — Unit tests for the waiter (moved from OperationsTest).
  • OperationsTest.java — Removed wait-related tests; retains get/list/delete tests.

Test plan

  • All existing unit tests pass (9 total across both test classes: 4 in OperationsTest, 5 in OperationWaiterTest)
  • No production code references to the removed methods remain
  • E2E test compilation verified

…ndation#50)

The wait/polling logic for async operations is now a test utility
(OperationWaiter) instead of part of the public API. This lets
library consumers implement their own polling strategy.

- Move wait(), WaitOptions, AbortSignal to OperationWaiter in test scope
- Update TestUtils and MultisigTest to use OperationWaiter
- Move wait-related unit tests to OperationWaiterTest
- Keep get/list/delete as the public Operations API
@iFergal
Copy link
Collaborator

iFergal commented Feb 17, 2026

Before reviewing this, @Kammerlo are you using this in Reeve? My intention for removing it was to promote that people translate operation polling to an event driven architecture in their applications, but you may be using it for convenience right now. Let me know if we can remove it.

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.

Move wait helper function to test utils

2 participants