Merge nucleic/lucid-river-toad-6efj into dev
This commit is contained in:
@@ -22,6 +22,10 @@ public sealed class FakeWslc : IWslc
|
||||
public long LastProcId;
|
||||
public Exception? NextError;
|
||||
|
||||
/// <summary>Set before a proc.exec to make that process emit during StartAsync — i.e. behave
|
||||
/// like a command that finishes instantly.</summary>
|
||||
public Action? NextProcessOnStart;
|
||||
|
||||
public string? WslcVersion => "9.9-test";
|
||||
|
||||
/// The fake is deliberately fully-capable: it stands in for a facade with BOTH wslc surfaces
|
||||
@@ -157,7 +161,10 @@ public sealed class FakeWslc : IWslc
|
||||
if (ContainerStates.GetValueOrDefault(spec.Container) != "running")
|
||||
throw new WslcError(WslcError.NotRunning, $"container {spec.Container} isn't running");
|
||||
LastProcId = procId;
|
||||
LastProcess = new FakeProcess();
|
||||
// Mirror the real facade: create and attach, but do NOT run — BrokerService runs it after
|
||||
// the procId response is on the wire.
|
||||
LastProcess = new FakeProcess { OnStart = NextProcessOnStart };
|
||||
NextProcessOnStart = null;
|
||||
return Task.FromResult<IWslcProcess>(LastProcess);
|
||||
}
|
||||
|
||||
@@ -167,6 +174,18 @@ public sealed class FakeWslc : IWslc
|
||||
public bool StdinClosed;
|
||||
public List<int> Signals = [];
|
||||
public (int Cols, int Rows)? LastResize;
|
||||
public bool Started;
|
||||
|
||||
/// <summary>Lets a test stand in for a process that finishes DURING start — an `echo`,
|
||||
/// which is what exposed the response-ordering bug on hardware.</summary>
|
||||
public Action? OnStart;
|
||||
|
||||
public Task StartAsync(CancellationToken ct)
|
||||
{
|
||||
Started = true;
|
||||
OnStart?.Invoke();
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task WriteStdinAsync(ReadOnlyMemory<byte> data, CancellationToken ct)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user