Skip to content

Implement unit tests for Test2::Harness infrastructure (27 files) #327

@Koan-Bot

Description

@Koan-Bot

Context

The t/unit/Test2/Harness/ directory contains 27 test stubs for the inter-process infrastructure — collectors, IPC protocols, schedulers, preloading, reloading, resource management, and plugins. These form the plumbing of yath 2.0's distributed test execution.

Modules to test

Collector (9 files):

  • Collector.t, Collector/Auditor.t, Collector/Auditor/Job.t, Collector/Auditor/Run.t, Collector/Child.t, Collector/IOParser.t, Collector/IOParser/Stream.t, Collector/Preloaded.t, Collector/TapParser.t

IPC (8 files):

  • IPC/Connection.t, IPC/Protocol.t, IPC/Util.t
  • IPC/Protocol/AtomicPipe.t, IPC/Protocol/AtomicPipe/Connection.t
  • IPC/Protocol/IPSocket.t, IPC/Protocol/IPSocket/Connection.t
  • IPC/Protocol/UnixSocket.t, IPC/Protocol/UnixSocket/Connection.t

Scheduler (2 files):

  • Scheduler.t, Scheduler/Run.t

Other infrastructure (8 files):

  • Plugin.t, Preload/Stage.t, Reloader.t, Reloader/Inotify2.t, Reloader/Stat.t, Resource.t, Resource/JobCount.t

Suggested test scenarios

Collector

  • Collector.pm: finish() completion, event generation from test output
  • Auditor: test result auditing — pass/fail/skip/todo counting, subtest tracking
  • Auditor::Job: per-job auditing, BAIL_OUT handling
  • Auditor::Run: run-level auditing, aggregation
  • IOParser/Stream: streaming event parsing from test process stdout
  • TapParser: TAP protocol parsing, plan detection, diagnostic handling
  • Child: child process collector lifecycle
  • Preloaded: preloaded test collection mode

IPC protocols

  • Protocol base: start() / connect(), send_message() / get_message(), send_response() / get_request(), active() / health_check(), refuse_new_connections()
  • AtomicPipe: file-based atomic pipe communication
  • IPSocket: TCP socket IPC
  • UnixSocket: Unix domain socket IPC
  • Connection classes: per-connection state, message framing, reconnection

Scheduler

  • start(ipcs) — scheduling initialization
  • advance() — next-batch processing, job ordering by duration/priority
  • terminate(reason) — graceful shutdown
  • overall_status() / process_list() — status reporting
  • Run management: add/remove runs, job state transitions
  • abort() — marks runs halted, kills job PIDs

Other

  • Plugin base: plugin interface contract
  • Preload::Stage: preload stage definition and module grouping
  • Reloader: file change detection and module reloading
  • Reloader::Stat: stat-based change detection (polling)
  • Reloader::Inotify2: inotify-based change detection (Linux)
  • Resource/JobCount: job slot counting and allocation

Notes

IPC tests should cover all three transport protocols. Use AtomicPipe for CI-friendly tests (no port allocation needed). Test message ordering, concurrent sends, and connection failure recovery.

The Scheduler has known complexity around abort/halt handling — see abort_on_bail flag on runs. Test the BAIL_OUT → halt → abort cascade.

Metadata

Metadata

Assignees

No one assigned

    Labels

    2.0TestUnit tests cars

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions