Skip to content

Commit f433e54

Browse files
committed
tests fix
1 parent 71d758d commit f433e54

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/Client/OrchestrationServiceClientShim/ShimDurableTaskClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public override async Task<string> RestartAsync(
322322
},
323323
};
324324

325-
await this.Client.CreateTaskOrchestrationAsync(message);
325+
await this.Client.CreateTaskOrchestrationAsync(message, dedupeStatuses: null);
326326
return newInstanceId;
327327
}
328328

test/Client/OrchestrationServiceClientShim.Tests/ShimDurableTaskClientTests.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ public async Task RestartAsync_EndToEnd(bool restartWithNewInstanceId)
350350
// Capture the TaskMessage for verification becasue we will create this message at RestartAsync.
351351
TaskMessage? capturedMessage = null;
352352
this.orchestrationClient
353-
.Setup(x => x.CreateTaskOrchestrationAsync(It.IsAny<TaskMessage>()))
354-
.Callback<TaskMessage>(msg => capturedMessage = msg)
353+
.Setup(x => x.CreateTaskOrchestrationAsync(It.IsAny<TaskMessage>(), It.IsAny<Core.OrchestrationStatus[]?>()))
354+
.Callback<TaskMessage, Core.OrchestrationStatus[]?>((msg, _) => capturedMessage = msg)
355355
.Returns(Task.CompletedTask);
356356

357357
string restartedInstanceId = await this.client.RestartAsync(originalInstanceId, restartWithNewInstanceId);
@@ -367,7 +367,7 @@ public async Task RestartAsync_EndToEnd(bool restartWithNewInstanceId)
367367

368368
// Verify that CreateTaskOrchestrationAsync was called
369369
this.orchestrationClient.Verify(
370-
x => x.CreateTaskOrchestrationAsync(It.IsAny<TaskMessage>()),
370+
x => x.CreateTaskOrchestrationAsync(It.IsAny<TaskMessage>(), It.IsAny<Core.OrchestrationStatus[]?>()),
371371
Times.Once);
372372

373373
// Verify the captured message details
@@ -534,15 +534,19 @@ async Task RunScheduleNewOrchestrationInstanceAsync(
534534
{
535535
// arrange
536536
this.orchestrationClient.Setup(
537-
m => m.CreateTaskOrchestrationAsync(MatchStartExecutionMessage(name, input, options)))
537+
m => m.CreateTaskOrchestrationAsync(
538+
MatchStartExecutionMessage(name, input, options),
539+
It.IsAny<Core.OrchestrationStatus[]?>()))
538540
.Returns(Task.CompletedTask);
539541

540542
// act
541543
string instanceId = await this.client.ScheduleNewOrchestrationInstanceAsync(name, input, options, default);
542544

543545
// assert
544546
this.orchestrationClient.Verify(
545-
m => m.CreateTaskOrchestrationAsync(MatchStartExecutionMessage(name, input, options)),
547+
m => m.CreateTaskOrchestrationAsync(
548+
MatchStartExecutionMessage(name, input, options),
549+
It.IsAny<Core.OrchestrationStatus[]?>()),
546550
Times.Once());
547551

548552
if (options?.InstanceId is string str)

0 commit comments

Comments
 (0)