@@ -689,16 +689,58 @@ public async Task RestartingFunctionShouldSetInterruptedToFalse(Task<IFunctionSt
689689 session . ShouldBeNull ( ) ;
690690
691691 await store . Interrupt ( functionId ) . ShouldBeTrueAsync ( ) ;
692- await store . Interrupted ( functionId ) . ShouldBeAsync ( true ) ;
692+ ( await store . GetInterruptedFunctions ( ) ) . Any ( id => id == functionId ) . ShouldBeTrue ( ) ;
693693
694694 await store . RestartExecution (
695- functionId ,
695+ functionId ,
696696 owner : ReplicaId . NewId ( )
697697 ) . ShouldNotBeNullAsync ( ) ;
698-
699- await store . Interrupted ( functionId ) . ShouldBeAsync ( false ) ;
698+
699+ ( await store . GetInterruptedFunctions ( ) ) . Any ( id => id == functionId ) . ShouldBeFalse ( ) ;
700700 }
701-
701+
702+ public abstract Task ResetInterruptedClearsInterruptedFlag ( ) ;
703+ protected async Task ResetInterruptedClearsInterruptedFlag ( Task < IFunctionStore > storeTask )
704+ {
705+ var store = await storeTask ;
706+ var functionId1 = TestStoredId . Create ( ) ;
707+ var functionId2 = StoredId . Create ( functionId1 . Type , Guid . NewGuid ( ) . ToString ( ) ) ;
708+
709+ await store . CreateFunction (
710+ functionId1 ,
711+ "humanInstanceId1" ,
712+ param : Test . SimpleStoredParameter ,
713+ leaseExpiration : DateTime . UtcNow . Ticks ,
714+ postponeUntil : null ,
715+ timestamp : DateTime . UtcNow . Ticks ,
716+ parent : null ,
717+ owner : null
718+ ) ;
719+
720+ await store . CreateFunction (
721+ functionId2 ,
722+ "humanInstanceId2" ,
723+ param : Test . SimpleStoredParameter ,
724+ leaseExpiration : DateTime . UtcNow . Ticks ,
725+ postponeUntil : null ,
726+ timestamp : DateTime . UtcNow . Ticks ,
727+ parent : null ,
728+ owner : null
729+ ) ;
730+
731+ await store . Interrupt ( functionId1 ) . ShouldBeTrueAsync ( ) ;
732+ await store . Interrupt ( functionId2 ) . ShouldBeTrueAsync ( ) ;
733+
734+ ( await store . GetInterruptedFunctions ( ) ) . Count . ShouldBe ( 2 ) ;
735+
736+ await store . ResetInterrupted ( [ functionId1 ] ) ;
737+
738+ var interrupted = await store . GetInterruptedFunctions ( ) ;
739+ interrupted . Count . ShouldBe ( 1 ) ;
740+ interrupted . Any ( id => id == functionId2 ) . ShouldBeTrue ( ) ;
741+ interrupted . Any ( id => id == functionId1 ) . ShouldBeFalse ( ) ;
742+ }
743+
702744 public abstract Task MessagesCanBeFetchedAfterFunctionWithInitialMessagesHasBeenCreated ( ) ;
703745 public async Task MessagesCanBeFetchedAfterFunctionWithInitialMessagesHasBeenCreated ( Task < IFunctionStore > storeTask )
704746 {
@@ -1039,7 +1081,7 @@ protected async Task InterruptCountForNonExistingFunctionIsNull(Task<IFunctionSt
10391081 {
10401082 var functionId = TestStoredId . Create ( ) ;
10411083 var store = await storeTask ;
1042- ( await store . Interrupted ( functionId ) ) . ShouldBeNull ( ) ;
1084+ ( await store . GetFunction ( functionId ) ) . ShouldBeNull ( ) ;
10431085 }
10441086
10451087 public abstract Task DefaultStateCanSetAndFetchedAfterwards ( ) ;
0 commit comments