Ensure graceful handling of missing ParentInstanceId in ResumeBulkDispatchWorkflowActivity and add signal-based wait in DeleteWorkflowTests.
This commit is contained in:
parent
558902bb77
commit
641dd664d6
|
|
@ -26,7 +26,10 @@ internal class ResumeBulkDispatchWorkflowActivity(IBookmarkQueue bookmarkQueue,
|
|||
if (!waitForCompletion)
|
||||
return;
|
||||
|
||||
var parentInstanceId = (string)workflowState.Properties["ParentInstanceId"];
|
||||
if (!workflowState.Properties.TryGetValue("ParentInstanceId", out var parentInstanceIdValue))
|
||||
return;
|
||||
|
||||
var parentInstanceId = (string)parentInstanceIdValue;
|
||||
var activityTypeName = ActivityTypeNameHelper.GenerateTypeName<BulkDispatchWorkflows>();
|
||||
var stimulus = new BulkDispatchWorkflowsStimulus(parentInstanceId);
|
||||
var stimulusHash = stimulusHasher.Hash(activityTypeName, stimulus);
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@ public class DeleteWorkflowTests : AppComponentTest
|
|||
var workflowDefinitionManager = _scope1.ServiceProvider.GetRequiredService<IWorkflowDefinitionManager>();
|
||||
await workflowDefinitionManager.DeleteByDefinitionIdAsync(Workflows.DeleteWorkflow.DefinitionId);
|
||||
|
||||
// Wait for the event handler to process the deletion from the activity registry
|
||||
await _signalManager.WaitAsync(WorkflowDeletedSignal, 5000);
|
||||
|
||||
WorkflowTypeDeletedFromRegistry(_scope1, Workflows.DeleteWorkflow.Type);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue