From 11cefa83c6f75fca6e33d03fe82875a381ab999e Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 11 Dec 2025 19:36:28 -0800 Subject: [PATCH 1/2] Fix test ID sequencing flake --- tests/sentry/models/test_team.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/sentry/models/test_team.py b/tests/sentry/models/test_team.py index 001a72d5230eff..4e325056a49e9d 100644 --- a/tests/sentry/models/test_team.py +++ b/tests/sentry/models/test_team.py @@ -1,3 +1,4 @@ +from django.db import connection from django.test import override_settings from sentry.deletions.tasks.hybrid_cloud import schedule_hybrid_cloud_foreign_key_jobs_control @@ -60,8 +61,21 @@ def test_get_projects(self) -> None: def test_without_snowflake(self) -> None: user = self.create_user() org = self.create_organization(owner=user) + + with connection.cursor() as cursor: + cursor.execute("SELECT last_value FROM sentry_team_id_seq") + id_before = cursor.fetchone()[0] + team = self.create_team(organization=org) - assert team.id < 1_000_000_000 + + with connection.cursor() as cursor: + cursor.execute("SELECT last_value FROM sentry_team_id_seq") + id_after = cursor.fetchone()[0] + + # When snowflake is disabled, the ID should advance by exactly 1 + # (Tests that we used regular auto-increment, not snowflake generation) + assert id_after == id_before + 1 + assert team.id == id_after assert Team.objects.filter(id=team.id).exists() From b6e53314402a4a80aece3a0eab659e1d83100ff0 Mon Sep 17 00:00:00 2001 From: Ryan Brooks Date: Thu, 11 Dec 2025 19:51:18 -0800 Subject: [PATCH 2/2] Bump shuffle sharding --- .github/workflows/shuffle-tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/shuffle-tests.yml b/.github/workflows/shuffle-tests.yml index a4334dc56da37e..df3a4759a5a291 100644 --- a/.github/workflows/shuffle-tests.yml +++ b/.github/workflows/shuffle-tests.yml @@ -40,12 +40,13 @@ jobs: fail-fast: false matrix: # XXX: When updating this, make sure you also update MATRIX_INSTANCE_TOTAL. - instance: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + instance: + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21] env: # XXX: `MATRIX_INSTANCE_TOTAL` must be hardcoded to the length of `strategy.matrix.instance`. # If this increases, make sure to also increase `flags.backend.after_n_builds` in `codecov.yml`. - MATRIX_INSTANCE_TOTAL: 11 + MATRIX_INSTANCE_TOTAL: 22 steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7