fix(engine): discard cancelled pipeline results from uncooperative engines
This commit is contained in:
@@ -101,6 +101,21 @@ public class NestPipelineTests
|
||||
Assert.Contains("Default", error.Message);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CancellationDuringSolveDiscardsEvenAnEngineThatReturnsNormally()
|
||||
{
|
||||
using var cts = new CancellationTokenSource();
|
||||
var engine = new StubEngine(job =>
|
||||
{
|
||||
cts.Cancel();
|
||||
return OnePlate(job, new NestJobPlacement(job.Parts[0].Id, 0, 1, 1, 0));
|
||||
});
|
||||
|
||||
Assert.ThrowsAny<OperationCanceledException>(() =>
|
||||
NestPipeline.Run(engine, "IgnoresStop", Request("IgnoresStop", Item("bracket", 1)), null, cts.Token)
|
||||
);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CancellationPropagatesWithoutAResult()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user