def METHOD_NAME(
    self, process_instance: ProcessInstanceModel, task_name_starts_with: str, expected_size: int
) -> None:
    # The start_time recorded for each task should be nearly identical.
    bpmn_process_id = process_instance.bpmn_process_id
    task_models = TaskModel.query.filter_by(bpmn_process_id=bpmn_process_id).all()
    script_tasks = list(
        filter(
            lambda tm: tm.task_definition.bpmn_name is not None
            and tm.task_definition.bpmn_name.startswith(task_name_starts_with),
            task_models,
        )
    )
    assert len(script_tasks) == expected_size
    last_task = None
    for task_model in script_tasks:
        if last_task is None:
            last_task = task_model
            continue
        # Even through the script tasks sleep for .1 second, the difference in start times
        # should be less than 0.001 seconds - they should all start at the same time.
        assert (last_task.start_in_seconds - task_model.start_in_seconds) < 0.001  # type: ignore