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.

chore(ci): keep rust test flakes from evicting merge-queue PRs (#84800)

Georges-Antoine Assi36d2ed6dbe4f
diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml
index 80bc78a30ad2..012b1fd45ccd 100644
--- a/.github/workflows/ci-rust.yml
+++ b/.github/workflows/ci-rust.yml
@@ -117,50 +117,71 @@ jobs:
affected = set(json.loads(os.environ.get("AFFECTED_CRATES", "[]")))
packages = {
- "assignment-coordination": 11,
- "batch-import-worker": 124,
- "capture": 169,
- "capture-load-gen": 25,
- "capture-logs": 108,
- "common-alloc": 13,
- "common-compression": 6,
- "common-cookieless": 42,
- "common-database": 13,
- "common-dns": 10,
- "common-geoip": 13,
- "common-hypercache": 94,
- "common-kafka": 67,
- "common-metrics": 6,
- "common-profiler": 51,
- "common-s3": 31,
- "cohort-core": 45,
- "cohort-seeder": 60,
- "cymbal": 168,
- # Compile-heavy (deltalake dependency tree), light tests.
- "deltalite-core": 180,
- "deltalite-python": 60,
- "embedding-worker": 25,
- "feature-flags": 181,
- "health": 27,
- "hogvm": 36,
- "ingestion-consumer": 13,
- "k8s-awareness": 107,
- "kafka-assigner": 84,
- "kafka-deduplicator": 211,
- "lifecycle": 17,
- "limiters": 25,
- "personhog-coordination": 24,
- "personhog-identity": 40,
- "personhog-leader": 115,
- "personhog-replica": 140,
- "personhog-router": 38,
- "personhog-stateright": 220,
- "posthog-symbol-data": 19,
- "property-defs-rs": 136,
- "posthog-replay-anonymizer": 20,
- "replay-anonymizer-node": 10,
- "property-vals-rs": 5,
- "serve-metrics": 14,
+ "affected-services": 37,
+ "assignment-coordination": 5,
+ "batch-import-worker": 69,
+ "capture": 102,
+ "capture-load-gen": 38,
+ "capture-logs": 87,
+ "cohort-core": 22,
+ "cohort-event-shuffler": 25,
+ "cohort-seeder": 77,
+ "cohort-stream-processor": 146,
+ "common-alloc": 5,
+ "common-cache": 6,
+ "common-compression": 5,
+ "common-continuous-profiling": 9,
+ "common-cookieless": 103,
+ "common-database": 35,
+ "common-dns": 18,
+ "common-geoip": 5,
+ "common-hypercache": 36,
+ "common-ingestion-warnings": 59,
+ "common-kafka": 5,
+ "common-liveness": 5,
+ "common-metrics": 5,
+ "common-posthog": 18,
+ "common-profiler": 59,
+ "common-redis": 12,
+ "common-s3": 5,
+ "common-temporal": 12,
+ "common-types": 16,
+ "cymbal": 236,
+ "cymbal-proto": 5,
+ "deltalite-core": 5,
+ "deltalite-python": 5,
+ "embedding-worker": 90,
+ "feature-flags": 241,
+ "flags-consumer": 23,
+ "health": 5,
+ "hogql_parser_rs": 7,
+ "hogvm": 5,
+ "hypercache-server": 40,
+ "ingestion-consumer": 20,
+ "ingestion-control-plane": 41,
+ "k8s-awareness": 116,
+ "kafka-assigner": 175,
+ "kafka-assigner-proto": 5,
+ "kafka-deduplicator": 129,
+ "keyed-stash": 5,
+ "lifecycle": 5,
+ "limiters": 5,
+ "personhog-common": 7,
+ "personhog-coordination": 230,
+ "personhog-identity": 80,
+ "personhog-leader": 113,
+ "personhog-proto": 9,
+ "personhog-replica": 37,
+ "personhog-router": 114,
+ "personhog-stateright": 173,
+ "personhog-test-harness": 33,
+ "personhog-writer": 63,
+ "posthog-replay-anonymizer": 147,
+ "posthog-symbol-data": 15,
+ "property-defs-rs": 74,
+ "property-vals-rs": 70,
+ "replay-anonymizer-node": 5,
+ "serve-metrics": 5,
}
# Filter to only affected crates when selective builds are active.
@@ -184,8 +205,10 @@ jobs:
f.write('matrix={"include":[]}\n')
raise SystemExit(0)
- # Weights are approximate total durations (compile + test) in seconds,
- # calibrated against 2-week avg CI job times (last updated: 2026-05-07).
+ # Weights are approximate marginal durations (compile + test) in seconds,
+ # fitted by non-negative least squares over 2 weeks of shard job
+ # durations (job time = fixed overhead + sum of member weights;
+ # last updated: 2026-08-18).
# TARGET_MINUTES controls max wall-clock per shard; shard count is derived.
TARGET_MINUTES = 8
target_seconds = TARGET_MINUTES * 60
diff --git a/rust/.config/nextest.toml b/rust/.config/nextest.toml
index 09294ac6b0ae..aabdb79a06df 100644
--- a/rust/.config/nextest.toml
+++ b/rust/.config/nextest.toml
@@ -29,6 +29,13 @@ threads-required = "num-cpus"
# Run the whole suite even after a failure, so the JUnit output captures every
# failing/flaky test for Trunk instead of stopping at the first one.
fail-fast = false
+# One retry, CI only: timing-sensitive integration tests flake under runner
+# contention, and in the merge queue a single flake evicts a PR and restarts
+# CI for every entry behind it. A retried pass is reported as flaky in the
+# JUnit upload, so Trunk still tracks each occurrence; a real regression
+# fails both attempts. Queue-protection measure, not a fix — see
+# https://github.com/PostHog/posthog/issues/84781 for the deflake follow-up.
+retries = 1
[profile.ci.junit]
path = "junit.xml"