@@ -347,13 +347,12 @@ def test_two_projects_same_transaction(self, mock_detect_breakpoints):
347
347
348
348
@mock .patch ("sentry.api.endpoints.organization_events_trends_v2.detect_breakpoints" )
349
349
@mock .patch ("sentry.api.endpoints.organization_events_trends_v2.EVENTS_PER_QUERY" , 2 )
350
- @pytest .mark .skip (reason = "Flaking 1/17/2025" )
351
350
def test_two_projects_same_transaction_split_queries (self , mock_detect_breakpoints ):
352
351
project1 = self .create_project (organization = self .org )
353
352
project2 = self .create_project (organization = self .org )
354
353
355
354
# force these 2 transactions from different projects
356
- # to fall into the FIRST bucket when quering
355
+ # to fall into the FIRST bucket when querying
357
356
for i in range (2 ):
358
357
self .store_performance_metric (
359
358
name = TransactionMRI .DURATION .value ,
@@ -372,7 +371,7 @@ def test_two_projects_same_transaction_split_queries(self, mock_detect_breakpoin
372
371
hours_before_now = 2 ,
373
372
)
374
373
# force these 2 transactions from different projects
375
- # to fall into the SECOND bucket when quering
374
+ # to fall into the SECOND bucket when querying
376
375
self .store_performance_metric (
377
376
name = TransactionMRI .DURATION .value ,
378
377
tags = {"transaction" : "foo bar*" },
@@ -412,10 +411,20 @@ def test_two_projects_same_transaction_split_queries(self, mock_detect_breakpoin
412
411
trends_call_args_data_1 = mock_detect_breakpoints .call_args_list [0 ][0 ][0 ]["data" ]
413
412
trends_call_args_data_2 = mock_detect_breakpoints .call_args_list [1 ][0 ][0 ]["data" ]
414
413
415
- assert len (trends_call_args_data_1 [f"{ project1 .id } ,foo bar*" ]) > 0
416
- assert len (trends_call_args_data_1 [f'{ project2 .id } ,foo bar\\ \\ "' ]) > 0
417
- assert len (trends_call_args_data_2 [f'{ project1 .id } ,foo bar\\ \\ "' ]) > 0
418
- assert len (trends_call_args_data_2 [f"{ project2 .id } ,foo bar*" ]) > 0
414
+ # the order the calls happen in is non-deterministic because of the async
415
+ # nature making making the requests in a thread pool so check that 1 of
416
+ # the 2 possibilities happened
417
+ assert (
418
+ len (trends_call_args_data_1 .get (f"{ project1 .id } ,foo bar*" , {})) > 0
419
+ and len (trends_call_args_data_1 .get (f'{ project2 .id } ,foo bar\\ \\ "' , {})) > 0
420
+ and len (trends_call_args_data_2 .get (f'{ project1 .id } ,foo bar\\ \\ "' , {})) > 0
421
+ and len (trends_call_args_data_2 .get (f"{ project2 .id } ,foo bar*" , {})) > 0
422
+ ) or (
423
+ len (trends_call_args_data_1 .get (f'{ project1 .id } ,foo bar\\ \\ "' , {})) > 0
424
+ and len (trends_call_args_data_1 .get (f"{ project2 .id } ,foo bar*" , {})) > 0
425
+ and len (trends_call_args_data_2 .get (f"{ project1 .id } ,foo bar*" , {})) > 0
426
+ and len (trends_call_args_data_2 .get (f'{ project2 .id } ,foo bar\\ \\ "' , {})) > 0
427
+ )
419
428
420
429
for trends_call_args_data in [trends_call_args_data_1 , trends_call_args_data_2 ]:
421
430
for k , v in trends_call_args_data .items ():
0 commit comments