diff --git a/tests/sentry/notifications/platform/shadow/test_shadow_read.py b/tests/sentry/notifications/platform/shadow/test_shadow_read.py index e31b7a51db23..90fda8f84607 100644 --- a/tests/sentry/notifications/platform/shadow/test_shadow_read.py +++ b/tests/sentry/notifications/platform/shadow/test_shadow_read.py @@ -381,7 +381,12 @@ def matrix_invocation( if "assigned" in toggles: GroupAssignee.objects.assign(group, self.team) - workflow = self.create_workflow(organization=self.organization) + # The legacy Slack path reads the environment off the Workflow, while the platform + # path reads it from workflow_env, so keep them in sync like production does. + workflow = self.create_workflow( + organization=self.organization, + environment=self.environment if "env" in toggles else None, + ) if "legacy_rule" in toggles: self.create_alert_rule_workflow( rule_id=self.create_project_rule(project=project).id, workflow=workflow @@ -391,7 +396,7 @@ def matrix_invocation( event_data=WorkflowEventData( event=event, group=Group.objects.get_from_cache(id=group.id), - workflow_env=self.environment if "env" in toggles else None, + workflow_env=workflow.environment, ), action=action, detector=detector,