feat: expose mapped raw and uns data through grpc adapters
This commit is contained in:
@@ -46,6 +46,30 @@ public sealed class WorkerSoftClockTests
|
||||
return worker;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Physical_lease_stays_charged_through_transport_timeout_until_worker_actually_answers()
|
||||
{
|
||||
var timeout = TimeSpan.FromMilliseconds(150);
|
||||
await using var runner = Runner(TimeSpan.FromMilliseconds(300));
|
||||
var worker = await WarmAsync(runner, "physical");
|
||||
var lease = new PhysicalLease();
|
||||
ScriptRunOutcome outcome;
|
||||
using (ProcessFreezer.Freeze(worker.Pid))
|
||||
{
|
||||
outcome = await runner.RunAsync(Scripts.Vt("physical", Trivial, timeout) with { PhysicalLease = lease }, Ct)
|
||||
.WaitAsync(TimeSpan.FromSeconds(10), Ct);
|
||||
outcome.Status.ShouldBe(ScriptRunStatus.Unavailable);
|
||||
lease.Disposals.ShouldBe(0);
|
||||
}
|
||||
await outcome.Recovery.ShouldNotBeNull().WaitAsync(TimeSpan.FromSeconds(10), Ct);
|
||||
lease.Disposals.ShouldBe(1);
|
||||
}
|
||||
private sealed class PhysicalLease : IDisposable
|
||||
{
|
||||
private int _disposals; public int Disposals => Volatile.Read(ref _disposals);
|
||||
public void Dispose() => Interlocked.Increment(ref _disposals);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The issue's headline: a worker that cannot be scheduled for longer than T, but shorter than the transport
|
||||
/// deadline, answers a trivial script with its value. Before #827 the host's clock, started at submit, answered
|
||||
|
||||
Reference in New Issue
Block a user