holoscan.testing
Module Contents
Classes
Functions
API
Own a failed capture’s sample metadata and native error without retaining the payload or a finite read claim.
Return the native error code and detail explaining why capture failed.
Return native sample metadata associated with the failed capture.
Bases: enum.Enum
Observe one positive period-boundary tick with a shared clock initially frozen at zero.
The startup tick is real. This restricted profile is not an operator stepping API.
Positive bound on native observation records and total publication attempts; defaults to 1024.
Positive tick coordinate in integer nanoseconds, exactly on a boundary of the operator clock period.
Positive steady-clock cooperative watchdog in integer milliseconds, independent of synthetic time; defaults to 30000.
Bases: enum.Enum
Construct fresh registered C++ or Python operators through ordinary Graph services.
Replace the selected output policy with value capture and a positive finite record limit.
Tensor-bearing outputs require capture_snapshot or explicit capture_native. Overflow fails the run without silent truncation; Python objects retain identity rather than an implicit deep copy.
Opt into native Tensor retention, retaining source backing instead of copying to host.
The finite source, single output, capacity and completion must satisfy native admission. None selects the default Retain record limit.
Replace the output policy with independent host snapshots.
capacity bounds records; maximum_bytes bounds each complete record, including all admitted Tensor fields of a schema. Both limits are positive. Overflow fails capture without publishing a partial record.
Remove the input edge override and restore native fixture derivation.
Remove this port’s input queue depth override.
Remove this port’s input source device override.
Remove this port’s input source tensor spec override.
Remove this port’s input tensor spec override.
Clear both permissions while preserving staging and compile options.
Remove this port’s output device override.
Remove the output edge override and restore native fixture derivation.
Remove this port’s output tensor spec override.
Release the builder resources.
Existing results and independently owned running attempts remain valid.
Append one payload to an input.
Containers remain one payload; None is data on an admitted object port. Reject mixing grouped and independent producers for an input.
Atomically append one frame from a mapping or ordered unique (port, payload) pairs.
Values share the optional nanosecond capture coordinate; omitted ports publish nothing. Reject duplicate ports and mixing grouped and independent producers.
Atomically append an explicit batch in caller order.
Reject strings, bytes, bytearrays and mappings as ambiguous batches. Conversion failure leaves pending input unchanged.
Atomically append TestSample envelopes in caller order.
Capture coordinates do not sort inputs or advance time. Reject non-sample entries and invalid timestamps before staging changes.
Execute and join a fresh attempt.
By default, failure raises the native HoloscanError subclass with .result attached; check=False returns that result. Invalid configuration can still raise before a result exists. Joining releases the GIL and rejects Runtime callback contexts.
Start a fresh attempt owning resources independently of the builder.
Inputs must already be staged; payloads become available only in joined finish results. One active attempt per harness is permitted.
Run and join the restricted native clock-observation profile.
Requires one sample per scalar input, ordinary OnClock/LatestWithin/Skip semantics and capture of every output. Unsupported configurations reject before staged input is consumed. Checked failures expose .result.
Copy compile options for subsequent fresh attempts.
Later caller mutation does not change this copy. Native application order and active- attempt mutation rejection remain authoritative.
Replace the input edge options using the canonical Graph keyword rules.
Omitted/None fields take Graph defaults. With no keywords, set default options; use clear_input_flow to restore native fixture derivation. Values are copied. Invalid options and active attempts leave prior state intact.
Replace tested-operator input history depth, distinct from edge queue capacity.
None clears the override. Native range/direction checks and active-attempt rejection preserve previous configuration on failure.
Copy or clear staged-source CUDA placement.
Copy or clear a staged producer Tensor promise.
Copy or clear an operator Tensor input contract.
Copy replacement permissions; None denies both.
Reject active-attempt changes atomically.
Copy or clear tested-operator CUDA output placement.
Replace the output edge options using the canonical Graph keyword rules.
Omitted/None fields take Graph defaults. With no keywords, set default options; use clear_output_flow to restore native fixture derivation. Values are copied. Invalid options and active attempts leave prior state intact.
Copy or clear an operator Tensor output contract.
Replace parameters atomically after validating pending inputs, capture selectors and overrides.
Failed construction or validation preserves prior state. Automatic outputs follow new declarations; explicit selections must remain valid.
Request native Tensor backing without a host copy.
Admission requires a finite source with one output and proven capacity and completion; unsupported geometries reject.
Positive finite retained-record limit; defaults to 1024.
Overflow fails capture without truncating output.
Own an attempt created by OperatorTestHarness.run_async; finish joins it.
Report whether the native attempt is still active; do not join.
Return the native termination observation without joining the attempt.
Request cooperative stop and join with the GIL released.
This has no hard timeout and rejects Runtime callback joins. Use finish to inspect the resulting outcome.
Join normally with the GIL released and return the same result on repeated calls.
Default checking raises with .result attached; check=False returns a failed result for inspection. Reject joins from Runtime callbacks.
Create Core lifecycle control restricted by run-bound targets and source stages in the policy.
Graph permissions and transaction capacities remain required; creating control does not request restart.
Return the tested operator reference bound to this run, or bind the supplied plan reference through Core.
Foreign and stale identities reject.
Observe the captured record count without exposing unjoined payloads.
Admit the next pre-staged manual frame.
None or zero attempts release once without waiting; positive integer milliseconds allow bounded admission waiting. Success does not mean the frame has been computed or captured.
Request cooperative stop without joining; permitted in Runtime callbacks.
Wait up to timeout_ms milliseconds for a count; zero only polls.
Return False when the count is not reached before timeout or completion. This releases the GIL while waiting and never joins or reruns the operator.
Own copied schema metadata and independent host snapshots of every present admitted Tensor field.
Absent optional fields retain their absence.
Return copied schema metadata with Tensor members unset.
Use tensor() for field content; this metadata is not a complete payload to republish.
Return semantic sample metadata copied when the schema output was collected.
Return all admitted Tensor field names, including absent optional fields.
Return whether a known Tensor field was present.
Raise ValueError for an unknown field.
Return the independent host snapshot of a present Tensor field.
Raise ValueError for an absent or unknown field.
Own contiguous host content and original Tensor metadata independently of runtime pools.
This inspection record is not a Tensor for publication.
Return a Python bytes copy of contiguous logical Tensor content.
Source strides and offset describe the original allocation, not this host buffer.
Return the original DLPack element representation.
Return semantic sample metadata copied when the output was collected.
Return the original logical dimension extents.
Return the logical Tensor byte offset within its original source allocation.
Return the original layout strides in bytes, including explicit contiguous strides.
Return the original DLPack device, which can differ from the snapshot host storage.
Immutable tested-operator restart permissions, independent and denied by default.
Permit external control subject to the native runtime access policy.
Permit the tested operator to request its own restart.
Own joined diagnostics and captures independently of the harness.
Inspection never executes work. Python-object identity is retained; snapshots own host content. Retaining the plan can retain staged Tensor leases.
Return the controlled tick retirement or suppression outcome; ordinary runs return NOT_REQUESTED.
Return a copied list of compile and runtime diagnostics retained after join.
Report whether admission, capture and expected completion succeeded.
Watchdog expiry and capture failures fail the test; a clean stopped run needs expect_stop or the native controlled-clock/retention completion proof.
Return the compiled plan, including rejected-admission diagnostics.
Inspection does not execute it.
Return actual native run termination, independently of whether the test passed.
Return the failed capture error and sample metadata, or None if collection did not fail.
Reject unknown or uncaptured outputs. The failed payload is not retained.
Return the named input selection at the completed controlled tick.
Reject ordinary runs, incomplete observations and unknown inputs.
Describe rejected admission, termination, capture errors and watchdog expiry; return an empty string on success.
Return value or native-retention captures with native sample metadata, preserving Python-object identity.
Raise ValueError for unknown, unselected or snapshot outputs.
Return the sole Tensor or schema snapshot.
Raise ValueError unless exactly one record exists, or for unknown, unselected or value- capture outputs.
Return independent host Tensor or schema snapshots in collection order, possibly empty.
Raise ValueError for unknown, unselected or value-capture outputs.
Return the sole value or native-retention payload.
Raise ValueError unless exactly one record exists, or for unknown, unselected or snapshot outputs.
Return a new list of value or native-retention captures in collection order, possibly empty.
Python objects are not deep-copied. Raise ValueError for unknown, unselected or snapshot outputs.
Configure one finite attempt.
Values are copied for the run; invalid options reject when the attempt starts.
Accept clean cooperative stop as expected.
Errors, watchdog expiry and missing controlled-clock/retention completion proof still fail.
Select automatic or manual finite frame release.
Manual release requires run_async and grouped input staging.
Positive steady-clock watchdog in integer milliseconds; defaults to 30000.
Expiry requests cooperative stop and fails the test, but cannot interrupt a blocked callback.
One payload with an optional integer nanosecond capture coordinate.
Opaque native owner created only by OperatorTestHarness.run_async.
Return the joined test result directly attached to an exception, if any.
Preserve the original result’s identity and partial outputs. Unrelated exceptions and attachments return None; causes are not searched. Inspection never executes or joins an operator.
Create one timestamped staging envelope.
Coordinates are signed 64-bit integer nanoseconds in the fixture clock domain; they do not advance time or schedule compute. Reject booleans, non-integers and out-of-range values.