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 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()