Context
The t/unit/Test2/Harness/ directory contains 12 test stubs for the core harness lifecycle — the instance orchestrator, run management, runner execution, and test settings. These are the heart of the 2.0 multi-process architecture.
Modules to test
Harness entry:
t/unit/Test2/Harness.t → Test2::Harness
Instance (orchestrator):
t/unit/Test2/Harness/Instance.t → Test2::Harness::Instance
t/unit/Test2/Harness/Instance/Message.t, Instance/Request.t, Instance/Response.t
Run & Job:
t/unit/Test2/Harness/Run.t → Test2::Harness::Run
t/unit/Test2/Harness/Run/Job.t → Test2::Harness::Run::Job
Runner:
t/unit/Test2/Harness/Runner.t → Test2::Harness::Runner
t/unit/Test2/Harness/Runner/Preloading.t, Runner/Preloading/Stage.t
Test configuration:
t/unit/Test2/Harness/TestFile.t → Test2::Harness::TestFile
t/unit/Test2/Harness/TestSettings.t → Test2::Harness::TestSettings
Suggested test scenarios
Instance (orchestrator)
run(cb) — callback execution, error handling
stop() — graceful shutdown
handle_request(request) — request routing and response
terminate(reason) — termination with reason tracking (first-reason-wins semantics)
api_abort() / api_kill() — cascading abort/kill to scheduler + runner
Run & Job
- Run:
set_ipc() / ipc(), run_id generation, abort_on_bail attribute (default true), halt state transitions
- Job: job data construction, environment setup, test file association
Runner
ready() — readiness check
start() / stop() / abort() / reload() — lifecycle methods
job_launch_data() — job execution data preparation
skip_job() — skip logic
launch_job() — job forking and execution
is_daemon attribute behavior
Runner::Preloading
- Stage management, module preloading, stage-based test routing
TestFile & TestSettings
- TestFile: test file metadata extraction, category/duration detection
- TestSettings: settings composition, per-test overrides
Notes
These are high-value tests — the Instance/Runner/Scheduler triad is the core of yath 2.0's multi-process architecture. Mock the IPC layer (use simple in-process message passing) to test orchestration logic without actual forking.
The terminate() method's first-reason-wins semantics is critical — test concurrent termination attempts.
Context
The
t/unit/Test2/Harness/directory contains 12 test stubs for the core harness lifecycle — the instance orchestrator, run management, runner execution, and test settings. These are the heart of the 2.0 multi-process architecture.Modules to test
Harness entry:
t/unit/Test2/Harness.t→Test2::HarnessInstance (orchestrator):
t/unit/Test2/Harness/Instance.t→Test2::Harness::Instancet/unit/Test2/Harness/Instance/Message.t,Instance/Request.t,Instance/Response.tRun & Job:
t/unit/Test2/Harness/Run.t→Test2::Harness::Runt/unit/Test2/Harness/Run/Job.t→Test2::Harness::Run::JobRunner:
t/unit/Test2/Harness/Runner.t→Test2::Harness::Runnert/unit/Test2/Harness/Runner/Preloading.t,Runner/Preloading/Stage.tTest configuration:
t/unit/Test2/Harness/TestFile.t→Test2::Harness::TestFilet/unit/Test2/Harness/TestSettings.t→Test2::Harness::TestSettingsSuggested test scenarios
Instance (orchestrator)
run(cb)— callback execution, error handlingstop()— graceful shutdownhandle_request(request)— request routing and responseterminate(reason)— termination with reason tracking (first-reason-wins semantics)api_abort()/api_kill()— cascading abort/kill to scheduler + runnerRun & Job
set_ipc()/ipc(), run_id generation,abort_on_bailattribute (default true),haltstate transitionsRunner
ready()— readiness checkstart()/stop()/abort()/reload()— lifecycle methodsjob_launch_data()— job execution data preparationskip_job()— skip logiclaunch_job()— job forking and executionis_daemonattribute behaviorRunner::Preloading
TestFile & TestSettings
Notes
These are high-value tests — the Instance/Runner/Scheduler triad is the core of yath 2.0's multi-process architecture. Mock the IPC layer (use simple in-process message passing) to test orchestration logic without actual forking.
The
terminate()method's first-reason-wins semantics is critical — test concurrent termination attempts.