avalanchego icon indicating copy to clipboard operation
avalanchego copied to clipboard

P-chain UTs consolidation 3 - Fork Handling

Open abi87 opened this issue 1 year ago • 1 comments

Why this should be merged

P-chain unit tests needs to be easier to maintain. Specifically I currently find non-trivial to understand what specific fork a unit test is testing and possibly to update the tests to the latest fork. Also fork times do not make sense and vm clock is not set to fullfil them. This PR, centralizes and simplifies fork setting in UTs. It also fixes a few subtly broken UTs. Thanks @joshua-kim and @marun for the discussions that brought me to these changes.

This PR replaces https://github.com/ava-labs/avalanchego/pull/1530, a very similar, previous attempt which lacked centralization of testing utilities in test setup package

How this works

Just refactor tests so that the latest active fork is explictly set upon vm creation and vm.clock is set to make the fork active.

How this was tested

Testing test is tricky. I guess I tested by manual inspection

abi87 avatar Oct 15 '23 20:10 abi87

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will cause this PR to ignore lifecycle events.

github-actions[bot] avatar Mar 03 '24 00:03 github-actions[bot]