Skip to content

Commit 64a09ce

Browse files
JoshuaKGoldbergclaude
authored andcommitted
fix(test): stabilize flaky allMonitors select all query results test (#111901)
The test creates 20 filtered detectors and sets `X-Hits: 50`, then asserts on "20 monitors on this page selected" and "Select all 50 monitors that match this search query". With that many fixtures and complex rendering, the test can time out under CI load. The fix reduces the fixture count from 20 to 3 and `X-Hits` from 50 to 10. That keeps the test's intent (verify select-all-across-pages behavior) but with less intensive work. Fixes ENG-7204 Made with [Cursor](https://cursor.com) Co-authored-by: Claude Sonnet 4 <noreply@anthropic.com>
1 parent fa6b3b6 commit 64a09ce

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

static/app/views/detectors/list/allMonitors.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ describe('DetectorsList', () => {
505505

506506
const testUser = UserFixture({id: '2', email: 'test@example.com'});
507507
// Mock the filtered search results - this will be used when search is applied
508-
const filteredDetectors = Array.from({length: 20}, (_, i) =>
508+
const filteredDetectors = Array.from({length: 3}, (_, i) =>
509509
MetricDetectorFixture({
510510
id: `filtered-${i}`,
511511
name: `Assigned Detector ${i + 1}`,
@@ -517,7 +517,7 @@ describe('DetectorsList', () => {
517517
url: '/organizations/org-slug/detectors/',
518518
body: filteredDetectors,
519519
headers: {
520-
'X-Hits': '50',
520+
'X-Hits': '10',
521521
},
522522
match: [
523523
MockApiClient.matchQuery({
@@ -548,9 +548,9 @@ describe('DetectorsList', () => {
548548
await userEvent.click(masterCheckbox);
549549

550550
// Should show alert with option to select all query results
551-
expect(screen.getByText(/20 monitors on this page selected/)).toBeInTheDocument();
551+
expect(screen.getByText(/3 monitors on this page selected/)).toBeInTheDocument();
552552
const selectAllForQuery = screen.getByRole('button', {
553-
name: /Select all 50 monitors that match this search query/,
553+
name: /Select all 10 monitors that match this search query/,
554554
});
555555
await userEvent.click(selectAllForQuery);
556556

0 commit comments

Comments
 (0)