Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,45 @@ public override Task ParameterAndStateAreNotUpdatedWhenEpochDoesNotMatch()


[TestMethod]
public override Task RestartExecutionsReturnsEmptyDictionaryWhenNoFlowsAreEligible()
=> RestartExecutionsReturnsEmptyDictionaryWhenNoFlowsAreEligible(FunctionStoreFactory.Create());
public override Task ClaimFunctionsReturnsEmptyDictionaryWhenNoFlowsAreEligible()
=> ClaimFunctionsReturnsEmptyDictionaryWhenNoFlowsAreEligible(FunctionStoreFactory.Create());




[TestMethod]
public override Task RestartExecutionsRestartsMultipleUnownedFlows()
=> RestartExecutionsRestartsMultipleUnownedFlows(FunctionStoreFactory.Create());
public override Task ClaimFunctionsRestartsMultipleUnownedFlows()
=> ClaimFunctionsRestartsMultipleUnownedFlows(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionsRestartsOnlyUnownedFlows()
=> RestartExecutionsRestartsOnlyUnownedFlows(FunctionStoreFactory.Create());
public override Task ClaimFunctionsRestartsOnlyUnownedFlows()
=> ClaimFunctionsRestartsOnlyUnownedFlows(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionsReturnsEmptyDictionaryForEmptyInput()
=> RestartExecutionsReturnsEmptyDictionaryForEmptyInput(FunctionStoreFactory.Create());
public override Task ClaimFunctionsReturnsEmptyDictionaryForEmptyInput()
=> ClaimFunctionsReturnsEmptyDictionaryForEmptyInput(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionsIncludesExistingEffects()
=> RestartExecutionsIncludesExistingEffects(FunctionStoreFactory.Create());
public override Task ClaimFunctionsIncludesExistingEffects()
=> ClaimFunctionsIncludesExistingEffects(FunctionStoreFactory.Create());

[TestMethod]
public override Task SetFunctionUpdatesStatusOwnerAndEffectsWhenGuardMatches()
=> SetFunctionUpdatesStatusOwnerAndEffectsWhenGuardMatches(FunctionStoreFactory.Create());

[TestMethod]
public override Task SetFunctionReturnsFalseAndNoOpsWhenExpectedReplicaDoesNotMatch()
=> SetFunctionReturnsFalseAndNoOpsWhenExpectedReplicaDoesNotMatch(FunctionStoreFactory.Create());

[TestMethod]
public override Task SetFunctionWithNullOwnerReleasesOwnership()
=> SetFunctionWithNullOwnerReleasesOwnership(FunctionStoreFactory.Create());

[TestMethod]
public override Task SetFunctionWithNullEffectsLeavesEffectsUntouched()
=> SetFunctionWithNullEffectsLeavesEffectsUntouched(FunctionStoreFactory.Create());

[TestMethod]
public override Task SetFunctionKeepsPassedSessionCoherentWithPersistedEffects()
=> SetFunctionKeepsPassedSessionCoherentWithPersistedEffects(FunctionStoreFactory.Create());
}
24 changes: 14 additions & 10 deletions Core/Cleipnir.ResilientFunctions.Tests/InMemoryTests/StoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,16 @@ public override Task FunctionCanBeCreatedWithEffectsOnly()
=> FunctionCanBeCreatedWithEffectsOnly(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionReturnsEffects()
=> RestartExecutionReturnsEffects(FunctionStoreFactory.Create());
public override Task ClaimFunctionReturnsEffects()
=> ClaimFunctionReturnsEffects(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionWorksWithEmptyEffects()
=> RestartExecutionWorksWithEmptyEffects(FunctionStoreFactory.Create());
public override Task ClaimFunctionWorksWithEmptyEffects()
=> ClaimFunctionWorksWithEmptyEffects(FunctionStoreFactory.Create());

[TestMethod]
public override Task ClaimFunctionSurfacesResult()
=> ClaimFunctionSurfacesResult(FunctionStoreFactory.Create());

[TestMethod]
public override Task FunctionOwnedByReplicaIsPostponedAfterRescheduleFunctionsInvocation()
Expand Down Expand Up @@ -212,14 +216,14 @@ public override Task GetResultsReturnsOnlyExistingFunctionResults()


[TestMethod]
public override Task RestartExecutionsDoesNotReturnFlowClaimedByPreviousCall()
=> RestartExecutionsDoesNotReturnFlowClaimedByPreviousCall(FunctionStoreFactory.Create());
public override Task ClaimFunctionsDoesNotReturnFlowClaimedByPreviousCall()
=> ClaimFunctionsDoesNotReturnFlowClaimedByPreviousCall(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionsDoesNotClaimSucceededFlow()
=> RestartExecutionsDoesNotClaimSucceededFlow(FunctionStoreFactory.Create());
public override Task ClaimFunctionsDoesNotClaimSucceededFlow()
=> ClaimFunctionsDoesNotClaimSucceededFlow(FunctionStoreFactory.Create());

[TestMethod]
public override Task RestartExecutionsClaimsSuspendedFlow()
=> RestartExecutionsClaimsSuspendedFlow(FunctionStoreFactory.Create());
public override Task ClaimFunctionsClaimsSuspendedFlow()
=> ClaimFunctionsClaimsSuspendedFlow(FunctionStoreFactory.Create());
}
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ protected async Task StoreCanHandleMultipleEffectsWithSameIdOnDifferentSessions(
);

await store.RescheduleCrashedFunctions(crashingReplicaId);
var storageSession2 = await store.RestartExecution(
var storageSession2 = await store.ClaimFunction(
storedId,
owner: ReplicaId.NewId()
).SelectAsync(s => s!.StorageSession);
Expand Down
Loading
Loading