fix: avoid flaky test_trigger_run_history by polling for first execution#2493
fix: avoid flaky test_trigger_run_history by polling for first execution#2493
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary of ChangesHello @trygveu, 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 an intermittent failure in an integration test by introducing a robust polling mechanism. The Highlights
🧠 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. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request fixes a flaky test, test_trigger_run_history, by introducing a polling mechanism to wait for a scheduled trigger to execute. The approach is sound and correctly uses a timeout to prevent the test from hanging. I've added one comment regarding the use of hardcoded values for the timeout and polling interval, suggesting they be defined as constants for better maintainability, in line with the repository's style guide.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lastUpdatedTime is server-managed and can be bumped by a concurrent CI job upserting the same long-lived shared workflow between the fixture capture and the retrieve call. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2493 +/- ##
=======================================
Coverage 48.86% 48.86%
=======================================
Files 191 191
Lines 26162 26162
=======================================
Hits 12783 12783
Misses 13379 13379 🚀 New features to boost your workflow:
|
Summary
test_trigger_run_historyimmediately calledget_trigger_run_history()after fixture setup, but the cron trigger (* * * * *) may not have fired yet (up to ~60 s until the next tick).assert len(history) > 0with a polling loop (every 5 s, up to 90 s) that breaks once history is non-empty and fails with a clear message on timeout.