hiero-ledger / hiero-ledger/hiero-consensus-node

Support per-class lifecycle

Open
#19,981 0 comments 0 reactions 0 assignees View on GitHub
Otter
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

By default, a `TestEnvironment` has a per-method lifecycle because this is the default behavior of JUnit. This means that a `TestEnvironment` and its included classes are created for each method and destroyed once the method ends.

In some scenarios, we want to reuse the environment (particularly the network) in multiple test methods. We should use the standard JUnit mechanism `@TestInstance(Lifecycle.PER_CLASS)` to enable this.

In addition, we should support the definition of `TestEnvironment` as a field if the lifecycle is per-class.

Contributor guide

Open the contributing guide

Research direction

Start by locating TestEnvironment and the existing JUnit lifecycle handling. Read how environments are currently created and destroyed, then verify the per-class behavior and field-based definition against JUnit's @TestInstance(Lifecycle.PER_CLASS) semantics; done means both requested forms work without breaking per-method behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.