Documentation
¶
Overview ¶
Package testfixture provides an explicitly driven durable host executor for control tests.
Index ¶
- type CrashPoint
- type DurableExecutor
- func (e *DurableExecutor) Accept(ctx context.Context, submission control.Submission) (control.JobRecord, error)
- func (e *DurableExecutor) Cancel(ctx context.Context, scope, id string) (control.JobRecord, error)
- func (e *DurableExecutor) Close() error
- func (e *DurableExecutor) RunQueued(ctx context.Context, scope, id string) (control.JobRecord, error)
- func (e *DurableExecutor) Status(ctx context.Context, scope, id string) (control.JobRecord, error)
- type ExecutorConfig
- type Result
- type RunFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrashPoint ¶
type CrashPoint string
CrashPoint names a durable boundary for deterministic process crash injection.
const ( // BeforeAcceptance precedes any durable request binding. BeforeAcceptance CrashPoint = "before_acceptance" // AfterAcceptance follows durable request binding, before acknowledgement. AfterAcceptance CrashPoint = "after_acceptance" // AfterClaim follows a durable claim and precedes entry to the runner. AfterClaim CrashPoint = "after_claim" // AfterEffect is called by the host runner after its real external effect. AfterEffect CrashPoint = "after_effect" // BeforeCompletion precedes terminal commit and permits cancellation arbitration. BeforeCompletion CrashPoint = "before_completion" // AfterCompletion follows durable terminal commit, before returning to the host. AfterCompletion CrashPoint = "after_completion" )
type DurableExecutor ¶
type DurableExecutor struct {
// contains filtered or unexported fields
}
DurableExecutor retains scoped request identity and job state across host replacement. Only RunQueued dispatches work; opening or accepting never starts a worker.
func OpenExecutor ¶
func OpenExecutor(cfg ExecutorConfig) (_ *DurableExecutor, err error)
OpenExecutor acquires exclusive host ownership and interrupts lost execution claims.
func (*DurableExecutor) Accept ¶
func (e *DurableExecutor) Accept(ctx context.Context, submission control.Submission) (control.JobRecord, error)
Accept atomically binds a scoped request key before acknowledging a job.
func (*DurableExecutor) Cancel ¶
Cancel persists cancellation intent before signaling owned execution.
func (*DurableExecutor) Close ¶
func (e *DurableExecutor) Close() error
Close fences this owner and releases exclusive directory ownership. In-flight runners may return later, but can no longer publish their results.
type ExecutorConfig ¶
type ExecutorConfig struct {
Dir string
Run RunFunc
Checkpoint func(CrashPoint) error
}
ExecutorConfig binds one exclusively owned disk directory and a host runner.
type Result ¶
type Result struct {
Stopped bool
Finalized bool
Canceled bool
ExperimentID string
Attempt eval.AttemptKey
Manifest inspect.ManifestRef
}
Result describes established execution and finalization facts, not cancellation intent.