Skip to content

Conversation

@sahaajaaa
Copy link
Contributor

@sahaajaaa sahaajaaa commented Dec 17, 2025

Description

Addresses an issue where Dataplex AspectTypes created during integration tests were not consistently deleted. This accumulation led to exceeding the AspectType quota.
To prevent this, the test setup now includes a step to list and delete all existing AspectTypes within the test project and location before attempting to create any new ones. This ensures a clean state for each test run and avoids hitting the quota.

PR Checklist

Thank you for opening a Pull Request! Before submitting your PR, there are a
few things you can do to make sure it goes smoothly:

  • 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 #2057

@sahaajaaa sahaajaaa requested a review from a team as a code owner December 17, 2025 12:15
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @sahaajaaa, 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 a critical issue in Dataplex integration tests where AspectTypes were not consistently deleted, leading to an accumulation that eventually exceeded the service's quota. The solution involves implementing a robust pre-test cleanup procedure, ensuring that each test run begins in a pristine environment. This change significantly enhances the reliability and stability of the Dataplex integration test suite by preventing future quota-related failures.

Highlights

  • Dataplex Integration Test Reliability: Introduced a new cleanup mechanism to ensure Dataplex integration tests start with a clean slate, preventing the accumulation of AspectTypes and avoiding quota exhaustion.
  • Proactive Resource Management: A cleanupExistingAspectTypes function was added to list and delete all existing AspectTypes in the test project and location before test execution, improving test stability.
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 introduces a cleanup step in the Dataplex integration tests to delete existing AspectType resources before each test run, addressing a quota exhaustion issue. The implementation is sound, but I've identified a critical bug that could cause a panic due to a nil pointer dereference during error handling. I've also suggested a more robust alternative to using time.Sleep for waiting on resource deletion to prevent test flakiness. Addressing these points will make the test suite more reliable.

@sahaajaaa sahaajaaa force-pushed the toolbox-branch branch 4 times, most recently from 23d9225 to 449ad85 Compare December 17, 2025 17:26
@sahaajaaa sahaajaaa force-pushed the toolbox-branch branch 3 times, most recently from d4c8c1a to aa6fda2 Compare December 18, 2025 10:23
@averikitsch averikitsch changed the title fix: Fixing the bug - (b/464292540) chore: update dataplex aspecttypes integration tests Dec 18, 2025
Copy link
Contributor

@averikitsch averikitsch left a comment

Choose a reason for hiding this comment

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

I don't think this solution works if there are multiple tests running at the same time, but it does cover if the tests end early.

@averikitsch averikitsch added the tests: run Label to trigger Github Action tests. label Dec 19, 2025
@averikitsch
Copy link
Contributor

/gcbrun

@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Dec 19, 2025
@sahaajaaa
Copy link
Contributor Author

I don't think this solution works if there are multiple tests running at the same time, but it does cover if the tests end early.

You're right, thanks for spotting the concurrency issue. I've updated the code to only delete AspectTypes older than 2 hours at the start, making it safe for parallel runs while still cleaning up leaks from tests that ended early.

@sahaajaaa sahaajaaa closed this Dec 29, 2025
@sahaajaaa sahaajaaa reopened this Dec 29, 2025
@sahaajaaa sahaajaaa force-pushed the toolbox-branch branch 5 times, most recently from c858eba to 9e40c63 Compare January 2, 2026 11:28
Improved the cleanup strategy for Dataplex AspectTypes in tests. Before creating a new AspectType for a test, all existing AspectTypes(which are not deffered in previous runs) in the target project and location are now listed and deleted.
@averikitsch averikitsch added the tests: run Label to trigger Github Action tests. label Jan 7, 2026
@averikitsch
Copy link
Contributor

/gcbrun

@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jan 7, 2026
@averikitsch
Copy link
Contributor

/gcbrun

@averikitsch averikitsch enabled auto-merge (squash) January 7, 2026 18:41
@averikitsch averikitsch added the tests: run Label to trigger Github Action tests. label Jan 7, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jan 7, 2026
@averikitsch
Copy link
Contributor

/gcbrun

@averikitsch averikitsch added the tests: run Label to trigger Github Action tests. label Jan 9, 2026
@github-actions github-actions bot removed tests: run Label to trigger Github Action tests. labels Jan 9, 2026
Improved the cleanup strategy for Dataplex AspectTypes in tests. Before creating a new AspectType for a test, all existing AspectTypes(which are not deffered in previous runs) in the target project and location are now listed and deleted.
@averikitsch
Copy link
Contributor

/gcbrun

@averikitsch averikitsch added the tests: run Label to trigger Github Action tests. label Jan 12, 2026
@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jan 12, 2026
@averikitsch averikitsch added the tests: run Label to trigger Github Action tests. label Jan 13, 2026
@averikitsch
Copy link
Contributor

/gcbrun

@github-actions github-actions bot removed the tests: run Label to trigger Github Action tests. label Jan 13, 2026
@averikitsch averikitsch merged commit d69792d into googleapis:main Jan 13, 2026
14 checks passed
github-actions bot pushed a commit to bpranava/genai-toolbox that referenced this pull request Jan 13, 2026
…pis#2193)

## Description

Addresses an issue where Dataplex AspectTypes created during integration
tests were not consistently deleted. This accumulation led to exceeding
the AspectType quota.
To prevent this, the test setup now includes a step to list and delete
all existing AspectTypes within the test project and location *before*
attempting to create any new ones. This ensures a clean state for each
test run and avoids hitting the quota.

## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  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 googleapis#2057

Co-authored-by: Averi Kitsch <[email protected]> d69792d
vinodhinic pushed a commit to vinodhinic/genai-toolbox that referenced this pull request Jan 14, 2026
## Description

Addresses an issue where Dataplex AspectTypes created during integration
tests were not consistently deleted. This accumulation led to exceeding
the AspectType quota.
To prevent this, the test setup now includes a step to list and delete
all existing AspectTypes within the test project and location *before*
attempting to create any new ones. This ensures a clean state for each
test run and avoids hitting the quota.


## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  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 googleapis#2057

Co-authored-by: Averi Kitsch <[email protected]>
the-ericwang35 pushed a commit to the-ericwang35/genai-toolbox that referenced this pull request Jan 15, 2026
## Description

Addresses an issue where Dataplex AspectTypes created during integration
tests were not consistently deleted. This accumulation led to exceeding
the AspectType quota.
To prevent this, the test setup now includes a step to list and delete
all existing AspectTypes within the test project and location *before*
attempting to create any new ones. This ensures a clean state for each
test run and avoids hitting the quota.


## PR Checklist

> Thank you for opening a Pull Request! Before submitting your PR, there
are a
> few things you can do to make sure it goes smoothly:

- [ ] Make sure you reviewed

[CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md)
- [ ] Make sure to open an issue as a

[bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose)
  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 googleapis#2057

Co-authored-by: Averi Kitsch <[email protected]>
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.

Ensure that dataplex testing removes aspect types

5 participants