Skip to content

Commit a227154

Browse files
getsentry-botenochtangg
authored andcommitted
Revert "fix(taskworker): Make using taskworker the default option (#97928)"
This reverts commit 29f5b91. Co-authored-by: enochtangg <23560545+enochtangg@users.noreply.github.com>
1 parent 3755268 commit a227154

File tree

7 files changed

+14
-27
lines changed

7 files changed

+14
-27
lines changed

src/sentry/options/defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3372,7 +3372,7 @@
33723372
# Taskbroker flags
33733373
register(
33743374
"taskworker.enabled",
3375-
default=True,
3375+
default=False,
33763376
flags=FLAG_AUTOMATOR_MODIFIABLE,
33773377
)
33783378
register(

tests/sentry/api/endpoints/test_project_codeowners_details.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def test_basic_delete(self) -> None:
6565

6666
@patch("django.utils.timezone.now")
6767
def test_basic_update(self, mock_timezone_now: MagicMock) -> None:
68-
date = datetime(2023, 10, 3, tzinfo=timezone.utc)
69-
mock_timezone_now.return_value = date
7068
self.create_external_team(external_name="@getsentry/frontend", integration=self.integration)
7169
self.create_external_team(external_name="@getsentry/docs", integration=self.integration)
70+
date = datetime(2023, 10, 3, tzinfo=timezone.utc)
71+
mock_timezone_now.return_value = date
7272
raw = "\n# cool stuff comment\n*.js @getsentry/frontend @NisanthanNanthakumar\n# good comment\n\n\n docs/* @getsentry/docs @getsentry/ecosystem\n\n"
7373
data = {
7474
"raw": raw,

tests/sentry/issues/endpoints/test_project_codeowners_details.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,10 @@ def test_basic_delete(self) -> None:
6565

6666
@patch("django.utils.timezone.now")
6767
def test_basic_update(self, mock_timezone_now: MagicMock) -> None:
68-
date = datetime(2023, 10, 3, tzinfo=timezone.utc)
69-
mock_timezone_now.return_value = date
7068
self.create_external_team(external_name="@getsentry/frontend", integration=self.integration)
7169
self.create_external_team(external_name="@getsentry/docs", integration=self.integration)
70+
date = datetime(2023, 10, 3, tzinfo=timezone.utc)
71+
mock_timezone_now.return_value = date
7272
raw = "\n# cool stuff comment\n*.js @getsentry/frontend @NisanthanNanthakumar\n# good comment\n\n\n docs/* @getsentry/docs @getsentry/ecosystem\n\n"
7373
data = {
7474
"raw": raw,

tests/sentry/relocation/tasks/test_process.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -416,16 +416,9 @@ def test_fail_no_org_slug_when_saas_to_saas(
416416
assert not RelocationFile.objects.filter(relocation=self.relocation).exists()
417417

418418
# -1 minutes guarantees a timeout, even during synchronous execution.
419-
@patch("sentry.relocation.tasks.process.CROSS_REGION_EXPORT_TIMEOUT", timedelta(minutes=0))
420-
@patch(
421-
"sentry.relocation.services.relocation_export.service.control_relocation_export_service.request_new_export"
422-
)
419+
@patch("sentry.relocation.tasks.process.CROSS_REGION_EXPORT_TIMEOUT", timedelta(minutes=-1))
423420
def test_fail_due_to_timeout(
424-
self,
425-
mock_export_service: Mock,
426-
uploading_complete_mock: Mock,
427-
fake_message_builder: Mock,
428-
fake_kms_client: Mock,
421+
self, uploading_complete_mock: Mock, fake_message_builder: Mock, fake_kms_client: Mock
429422
):
430423
self.mock_message_builder(fake_message_builder)
431424
self.mock_kms_client(fake_kms_client)
@@ -448,7 +441,7 @@ def test_fail_due_to_timeout(
448441
assert relocation.status == Relocation.Status.FAILURE.value
449442
assert relocation.latest_notified == Relocation.EmailKind.FAILED.value
450443
assert relocation.failure_reason == ERR_UPLOADING_CROSS_REGION_TIMEOUT.substitute(
451-
delta=timedelta(minutes=0)
444+
delta=timedelta(minutes=-1)
452445
)
453446
assert fake_message_builder.call_count == 1
454447
assert fake_message_builder.call_args.kwargs["type"] == "relocation.failed"
@@ -459,9 +452,6 @@ def test_fail_due_to_timeout(
459452
assert fake_kms_client.return_value.get_public_key.call_count == 1
460453
assert fake_kms_client.return_value.asymmetric_decrypt.call_count == 0
461454

462-
# Verify that the export service was called but didn't complete successfully
463-
assert mock_export_service.call_count == 1
464-
465455
assert not RelocationFile.objects.filter(relocation=self.relocation).exists()
466456

467457

tests/sentry/tasks/test_code_owners.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,6 @@ def test_codeowners_auto_sync_successful(
9191
self, mock_get_codeowner_file: MagicMock, mock_timezone_now: MagicMock
9292
) -> None:
9393
with self.tasks() and self.feature({"organizations:integrations-codeowners": True}):
94-
mock_now = datetime(2023, 1, 1, 0, 0, tzinfo=timezone.utc)
95-
mock_timezone_now.return_value = mock_now
9694
self.create_external_team()
9795
self.create_external_user(external_name="@NisanthanNanthakumar")
9896
commit = Commit.objects.create(
@@ -107,6 +105,8 @@ def test_codeowners_auto_sync_successful(
107105
filename=".github/CODEOWNERS",
108106
type="A",
109107
)
108+
mock_now = datetime(2023, 1, 1, 0, 0, tzinfo=timezone.utc)
109+
mock_timezone_now.return_value = mock_now
110110
code_owners_auto_sync(commit.id)
111111

112112
code_owners = ProjectCodeOwners.objects.get(id=self.code_owners.id)

tests/sentry/tasks/test_relay.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ def test_debounce(
136136
):
137137
tasks = []
138138

139-
def capture(task=None, args=None, kwargs=None):
139+
def apply_async(args, kwargs):
140+
assert not args
140141
tasks.append(kwargs)
141142

142-
with mock.patch("sentry.taskworker.task.Task._signal_send", side_effect=capture):
143+
with mock.patch("sentry.tasks.relay.build_project_config.apply_async", apply_async):
143144
schedule_build_project_config(public_key=default_projectkey.public_key)
144145
schedule_build_project_config(public_key=default_projectkey.public_key)
145146

tests/sentry/workflow_engine/processors/test_detector.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,7 @@ def test_doesnt_send_metric(self) -> None:
338338

339339
with mock.patch("sentry.utils.metrics.incr") as mock_incr:
340340
process_detectors(data_packet, [detector])
341-
# Ensure that mock_incr was not called with "workflow_engine.process_detector"
342-
assert not any(
343-
call[0][0] == "workflow_engine.process_detector"
344-
for call in mock_incr.call_args_list
345-
)
341+
mock_incr.assert_not_called()
346342

347343

348344
@django_db_all

0 commit comments

Comments
 (0)