Skip to content

Conversation

@ravisiddhu
Copy link
Contributor

@ravisiddhu ravisiddhu commented Jan 8, 2026

Description

Fix: Fixed the flakiness in the list locks integration test for postgres

go test -tags=integration tests/postgres/postgres_integration_test.go
ok      command-line-arguments  14.392s

PR Checklist

  • Make sure you reviewed
    CONTRIBUTING.md
  • Make sure to open an issue as a
    bug/issue
    before writing your code! That way we can discuss the change, evaluate
    designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Make sure to add ! if this involve a breaking change

🛠️ Fixes #1738

@ravisiddhu ravisiddhu requested a review from a team as a code owner January 8, 2026 13:37
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ravisiddhu, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves flakiness in the PostgreSQL list locks integration test by implementing a robust setup mechanism. It ensures that a table is consistently created and locked before the test runs, providing a stable environment for verifying lock detection. The changes also streamline the test's data handling and assertion logic to accurately reflect the expected lock state.

Highlights

  • Improved Test Reliability: Introduced a new helper function, CreateAndLockPostgresTable, to programmatically create a test table and acquire an ACCESS EXCLUSIVE lock on it. This ensures a consistent and predictable state for the list locks integration test, addressing previous flakiness.
  • Refactored Test Logic: The RunPostgresListLocksTest function now utilizes the new helper to set up the locked table, and the expectResults flag for the test case has been updated to true, as a lock is now guaranteed to exist.
  • Updated Lock Details Structure and Verification: The lockDetails struct used for unmarshalling test results has been simplified, and the assertion logic has been modified to specifically check for the presence of AccessExclusiveLock within the Locks field, aligning with the new way lock information is retrieved.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request effectively addresses the flakiness of the list_locks integration test for PostgreSQL. The introduction of the CreateAndLockPostgresTable helper function is a solid approach to establish a deterministic state by creating a table and applying an explicit lock. The subsequent updates to the test case, including adjusting the expected results and refining the validation logic to check for a specific AccessExclusiveLock, are logical and improve the test's reliability. I have one suggestion to enhance the new helper function by using best practices for constructing SQL queries to mitigate any potential for SQL injection, even within a test context.

@ravisiddhu ravisiddhu added the tests: run Label to trigger Github Action tests. label Jan 8, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jan 8, 2026
@ravisiddhu ravisiddhu enabled auto-merge (squash) January 16, 2026 04:13
@ravisiddhu ravisiddhu added the tests: run Label to trigger Github Action tests. label Jan 16, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new custom tools in Postgres

2 participants