Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(test): bump async timeout for TrendsLineChart tests (#60225)

Sam Pennington872f38414967
diff --git a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
index 05f9af059512..3153c7896c0c 100644
--- a/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
+++ b/products/product_analytics/frontend/insights/trends/TrendsLineChart/TrendsLineChart.test.tsx
@@ -1,6 +1,6 @@
import '@testing-library/jest-dom'
-import { cleanup, fireEvent, screen, waitFor } from '@testing-library/react'
+import { cleanup, configure, fireEvent, screen, waitFor } from '@testing-library/react'
import { FEATURE_FLAGS } from 'lib/constants'
import { setupJsdom, setupSyncRaf } from 'lib/hog-charts/testing'
@@ -18,6 +18,10 @@ import {
import { buildAnnotation } from '~/test/insight-testing/test-data'
import { AnnotationScope, ChartDisplayType } from '~/types'
+// The full InsightViz tree is heavy to mount under jsdom; on contended CI shards
+// the default 1s waitFor / findBy timeout is too tight and flakes randomly.
+configure({ asyncUtilTimeout: 5000 })
+
let cleanupJsdom: () => void
let cleanupRaf: () => void