refactor: move wait helper from Operations to test utils#74
Open
yashhzd wants to merge 1 commit intocardano-foundation:mainfrom
Open
refactor: move wait helper from Operations to test utils#74yashhzd wants to merge 1 commit intocardano-foundation:mainfrom
yashhzd wants to merge 1 commit intocardano-foundation:mainfrom
Conversation
…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
Collaborator
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #50
Summary
The
wait()polling logic,WaitOptions, andAbortSignalhave been moved out of the productionOperationsclass into a newOperationWaitertest utility. This ensures library consumers are not coupled to a specific polling strategy and can implement their own.Changes
Operations.java— Removedwait()(3 overloads),WaitOptions, andAbortSignal. The public API now exposes onlyget(),list(), anddelete().OperationWaiter.java(new) — Test utility ine2e.utilscontaining the extracted wait/polling logic with exponential backoff, dependent operation handling, and abort signal support.TestUtils.java— UpdatedwaitOperation()to delegate toOperationWaiter.wait().MultisigTest.java— UpdatedwaitOperations()to useOperationWaiter.wait().OperationWaiterTest.java(new) — Unit tests for the waiter (moved fromOperationsTest).OperationsTest.java— Removed wait-related tests; retains get/list/delete tests.Test plan
OperationsTest, 5 inOperationWaiterTest)