Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it so that contract hapispec tests don't need to run as @OrderedIsolation #17709

Open
15 tasks
david-bakin-sl opened this issue Feb 4, 2025 · 0 comments
Open
15 tasks
Labels
Hedera Smart Contract Service Issues related to the Hedera Smart Contract Service.

Comments

@david-bakin-sl
Copy link
Member

Background

Many contract hapispec suites are using @OrderedInIsolation which means that each test in the suite is not only run separately from other tests in that suite but also from all other tests in other suites. This "single threads" most contract hapispec tests which leads to long elapsed times for running the contract tests.

This level of isolation is apparently needed because:

  • tests create resources like accounts and tokens
  • they execute operations against them and then assert against final state such as hbar/token balances
  • these resources are named with strings, e.g., "payer" or "fungible"
  • there's a lot of usage of the same names between tests and suites because they're generally describing a "role", like "payer" or "fungible"
  • and so the tests interfere with each other

Hapispec DSL framework should be enhanced so that resources created in one test are distinct from those in another test, even if given the same "simple" name. (Or some other mechanism should be used to enable this.). Then we can get rid of @OrderedInIsolation, and in fact, we won't even need @Ordered either for tests in the same suite.

Acceptance Criteria

  1. Remove @OrderedInIsolation annotations from contract suits and everything still runs reliably (no flakiness) after repeated separate test runs.

Dependencies

No response

Definition of Ready (DoR) Checklist

  • Clear acceptance criteria
  • Clear and detailed description
  • Dependencies identified
  • Links to documentation
  • Should be completable in 2-3 Days
  • Initial draft of Low-level design document
  • At least high level test plan
  • Groomed/Estimated

Definition of Done (DoD) Checklist

  • Acceptance Criteria complete
  • No Codacy issues greater than minor (in new code)
  • JavaDocs updated/created
  • Code commented
  • Unit tests created/updated
  • 80% test code coverage (in new code)
  • Happy Path and major negative cases in HAPI tests as applicable
@david-bakin-sl david-bakin-sl added the Hedera Smart Contract Service Issues related to the Hedera Smart Contract Service. label Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hedera Smart Contract Service Issues related to the Hedera Smart Contract Service.
Projects
Status: Backlog
Development

No branches or pull requests

1 participant