Skip to content

ResourceTimeSourceTestSuite: Rework to be more in-line with newer tests #342

Description

@YYDan

Description

ResourceTimeSourceTestSuite was never covered by the summer 2024 refactor campaign. It holds 39 asserts in 9 tests across 634 lines — 4.3 asserts per test. Five are addFact() and four are addTestAsync().

Test Kind Asserts Lines
Time Sources: Existence fact 11 54
Time Sources: Constant Values fact 10 21
Time Sources: Reconfiguration fact 5 31
Time Sources: Parents and Children fact 3 26
Time Sources: State Transitions fact 1 66
Time Sources: Expiry Frames async 2 170
Time Sources: Self Destruction async 4 59
Time Sources: Sibling Destruction async 1 65
Time Sources: Time delta propagation async

The five synchronous facts split straightforwardly and should be the focus. Constant Values in particular is ten independent constant checks in one fact and should become ten facts.

The four async tests should be treated with care. Each drives a time source across multiple frames and has its own timeout; splitting one into N tests means N separate multi-frame runs, which multiplies suite wall-clock time. Split these only where a scenario is genuinely independent, and prefer leaving a single stateful progression intact.

Target: roughly 35–40 tests.

Script Name

ResourceTimeSourceTestSuite

Steps To The Task

  • Split the five synchronous facts into one fact per scenario, named <original_name> #N
  • Split Time Sources: Constant Values into one fact per constant
  • Review each of the four async tests individually and split only where a scenario is independent, documenting in the PR why any that are left intact were left intact
  • Add section comment headers separating the synchronous and async groups
  • Update assert descriptions so they identify the specific scenario
  • Confirm the total assert count is unchanged (39) and that no test name is duplicated
  • Run the suite on VM and YYC, and check the suite's wall-clock time has not regressed unacceptably

Metadata

Metadata

Assignees

Labels

refactorAn improvement to existing test/module code

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions