Skip to content

fix: flaky ownershipTransfer e2e test#83

Merged
jeffsmale90 merged 1 commit into
mainfrom
chore/flaky_test
Oct 14, 2025
Merged

fix: flaky ownershipTransfer e2e test#83
jeffsmale90 merged 1 commit into
mainfrom
chore/flaky_test

Conversation

@jeffsmale90

@jeffsmale90 jeffsmale90 commented Sep 29, 2025

Copy link
Copy Markdown
Collaborator

📝 Description

The ownershipTransfer e2e tests were incorrectly passing the useroperation hash to the expectUserOperationToSucceed function, that actually expects a parameter of type UserOperationReceipt.

This assertion function was then ensuring that the receipt.success is true - but the assertion was not being executed.

This resulted in two problems:

  • the tests in ownershipTransfer e2e tests never awaited the receipt
  • the assertion was never checking that the user operation succeeds - in any test

🔄 What Changed?

  • Fixes expectUserOperationToSucceed parameter type
  • Fixes expectUserOperationToSucceed to actually execute toBeTruthy assertion
  • Fixes call to expectUserOperationToSucceed in flaky test to pass UserOperationReceipt rather than UserOperationHash

🧪 How to Test?

E2E tests should pass

🔗 Related Issues

Link to related issues:
Closes #
Related to #

📚 Additional Notes

Any additional information, concerns, or context:


Note

Ownership transfer e2e tests now wait for the user operation receipt and pass it to the assertion, which is updated to use viem’s UserOperationReceipt and correctly invoke toBeTruthy().

  • E2E Tests (packages/delegator-e2e/test/caveats/ownershipTransfer.test.ts):
    • Wait for UserOperationReceipt via waitForUserOperationReceipt({ hash }) and pass the receipt to expectUserOperationToSucceed (replacing direct userOpHash).
  • Test Utils (packages/delegator-e2e/test/utils/assertions.ts):
    • Change expectUserOperationToSucceed param type to viem/account-abstraction UserOperationReceipt.
    • Fix assertion to call toBeTruthy().
    • Remove UserOperationReceiptResponse import from @metamask/delegation-toolkit.

Written by Cursor Bugbot for commit c83f223. This will update automatically on new commits. Configure here.

@jeffsmale90 jeffsmale90 marked this pull request as draft September 29, 2025 03:08
- Fixes expectUserOperationToSucceed parameter type
- Fixes expectUserOperationToSucceed to actually execute toBeTruthy assertion
- Fixes call to expectUserOperationToSucceed in flaky test to pass UserOperationReceipt rather than UserOperationHash
@jeffsmale90 jeffsmale90 marked this pull request as ready for review September 29, 2025 22:23
@jeffsmale90 jeffsmale90 merged commit 356a8b0 into main Oct 14, 2025
17 checks passed
@jeffsmale90 jeffsmale90 deleted the chore/flaky_test branch October 14, 2025 02:42
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.

2 participants