Events

Provium's host-side scheduler and runners emit observability events that drive the human-readable summary, the --json output, provium-coverage, and any other consumer that wants to follow what the harness is doing.

The transport is length-prefixed msgpack frames (the same framing as the wire protocol). Get them via --save-events <path>, --events-stdout, or --events-socket <path>.

Frame shape #

Each frame is an EventFrame:

{
  "ts":      <i64>,    // ns since Unix epoch, host clock at emission
  "kind":    "<name>", // discriminator (snake_case)
  "payload": { … }     // variant-specific
}

The Event enum is flattened into the envelope so kind and payload appear at the top level of each frame.

PROTOCOL_VERSION (currently 1) is bumped on any wire-shape change. Adding a new variant or field is a strict version bump; removing or renaming one is breaking. See protocol version for the pinning policy.

File lifecycle #

file_discovered #

Emitted once per *.test.lua file before any dispatching begins.

FieldTypeDescription
pathstringTest-root-relative path.
fixture_refsarray of stringsFixtures referenced by vm_fixture(...) / lab_fixture(...) (path with .fixture.lua stripped).
declared_claimoptional ResourceAmountprovium:claim(...) declared at file scope, if any.

file_dispatched #

A test file was picked up by a runner thread.

FieldTypeDescription
pathstringFile path.
reservationResourceAmountResources reserved at dispatch (sum of runner overhead + claim).

file_blocked #

A test file is waiting on the resource pool or PSI pressure.

FieldTypeDescription
pathstringFile path.
waiting_forResourceAmountWhat the file is waiting on.
reasonstringpool_full, psi_pressure, etc.

file_completed #

A test file finished — successfully, with failures, or terminated by timeout / panic.

FieldTypeDescription
pathstringFile path.
statusenumpassed, failed, timed_out, crashed.
duration_nsu64Wall-clock duration.

crashed means the runner panicked or hit a test-infrastructure failure; remaining tests in the file are marked failed-due-to-poisoned-state.

Test lifecycle #

test_started #

A test() block within a file started.

FieldTypeDescription
pathstringContaining file's path.
namestringtest() block name.
metaMetaMapPer-test metadata. Always present; empty if none.

test_skipped #

The test was filtered or marked Skipped (declarative meta.skip, inline t:skip(), file-scope todo(), or tag/slow filter).

FieldTypeDescription
pathstringContaining file's path.
namestringTest name.
reasonstringFilter expression, t:skip() argument, or todo() argument.
metaMetaMapPer-test metadata.

test_passed #

FieldTypeDescription
pathstringFile path.
namestringTest name.
duration_nsu64Test wall-clock duration.
metaMetaMapPer-test metadata.

test_failed #

FieldTypeDescription
pathstringFile path.
namestringTest name.
duration_nsu64Wall-clock up to failure.
reasonstringAssertion message, exception text, or panic payload.
console_excerptstringLast 4 KiB from each booted VM's console log. May be empty.
metaMetaMapPer-test metadata.

VM lifecycle #

vm_spawned #

FieldTypeDescription
filestringFile that owns this VM.
vm_namestringName as given to lab:vm.
profilestringProfile used to boot.
memory_bytesu64Memory cap.
cidu32Assigned vsock CID.

vm_shutdown #

FieldTypeDescription
filestringFile that owned this VM.
vm_namestringVM name.
duration_nsu64VM uptime.

Pool and claims #

pool_state #

Periodic snapshot of resource-pool usage. Default cadence: 1 Hz.

FieldTypeDescription
usedResourceAmountCurrently in use.
availableResourceAmountCurrently free.

claim_acquired #

A file successfully claimed resources via provium:claim(...).

FieldTypeDescription
pathstringFile path the claim belongs to.
amountResourceAmountAmount claimed.

claim_released #

A file released its claim. Pairs with claim_acquired on the same path.

FieldTypeDescription
pathstringFile path.
amountResourceAmountAmount released.

Fixtures #

fixture_build_started #

FieldTypeDescription
pathstringFixture path (test-root-relative, no .fixture.lua).

fixture_build_done #

FieldTypeDescription
pathstringFixture path.
duration_nsu64Build duration.
snapshot_bytesu64Cached snapshot size, post-compression.

fixture_build_waiting #

A second file is waiting on the build lock another file holds.

FieldTypeDescription
pathstringFixture path being waited on.
held_by_filestringFile currently holding the build lock.

fixture_cache_hit #

A fixture was resumed from its cached snapshot — no rebuild required.

FieldTypeDescription
pathstringFixture path.

Shared types #

ResourceAmount #

{
  "memory_bytes": <u64>,
  "cpus":         <u32>
}

Used in pool / claim / reservation events.

MetaMap and MetaValue #

MetaMap is BTreeMap<String, MetaValue>. MetaValue is a tagged-by-type union over native msgpack types:

Variantmsgpack mapping
Nullunit / nil
Boolbool
Inti64
Floatf64
Strstr
Bytesbin (distinct from str)
Arrayarray of MetaValue
Mapmap of String → MetaValue

The deserialiser dispatches on the input type rather than relying on declaration-order fallthrough, so valid-UTF-8 byte sequences are not mis-classified as strings.

Event guarantees #

  • file_discovered for every discovered file, before any dispatching.
  • For each file: at most one file_dispatched, optional file_blocked(s) before it, exactly one file_completed after.
  • For each test: exactly one test_started, then exactly one of test_passed / test_failed / test_skipped.
  • claim_acquired and claim_released are paired per file.
  • fixture_build_started and fixture_build_done are paired per build. A fixture_build_waiting may precede the _done if the file queued behind a peer.
  • fixture_cache_hit fires AFTER successful restore — never on a corrupt entry that turns into a rebuild.

Consuming the stream #

The three output channels — --save-events <path> (file), --events-stdout (pipe), and --events-socket <path> (multi-consumer Unix socket) — and the patterns for choosing between them are covered in events and coverage.

See also #

Edit this page