Skip to content

CI Fix - Postgres CI Failing Sometimes #5972

Closed

Description

@cmgoffena13

Link: https://github.com/SQLMesh/sqlmesh/actions/runs/32076174970/job/95529820539

AI Notes

Failing test
tests/core/engine_adapter/integration/test_integration_postgres.py::test_grants_plan_clone_environment

What’s Wrong
The test uses a shared fixed Postgres user (test_reader). With parallel workers, another grants test can drop that user (DROP OWNED BY / DROP USER) mid-run. Grants on the physical table disappear ({}), or GRANT fails with role "test_reader" does not exist. Flaky test isolation, not a clone-grants product bug.

Possible Fix
In create_users in test_integration_postgres.py: give each run a unique username (e.g. test_reader_{random_id}) instead of a fixed test_reader.

Activity

  1. changed the title [-]CI Fix - Postgres CI Sometimes Failing[/-] [+]CI Fix - Postgres CI Failing Sometimes[/+] on Aug 21, 2026
  2. sakshipatil-hue commented on Aug 23, 2026

    @sakshipatil-hue
    Contributor

    @cmgoffena13 I would love to pick this up! I can update the create_users function in test_integration_postgres.py to append a random UUID to the test_reader username to ensure parallel test isolation.
    Let me know if that works!

  3. added a commit that references this issue on Aug 23, 2026
    cd83751
  4. cmgoffena13 commented on Aug 23, 2026

    @cmgoffena13
    CollaboratorAuthor

    Hey @sakshipatil-hue -- appreciate it, nice turn around, let me take a look at the PR!

  5. added a commit that references this issue on Aug 24, 2026
    ae1cb82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions