Skip to content

fix: strict driver teardown makes tests less flappy#1508

Open
DenKoren wants to merge 1 commit intomainfrom
fix/flappy-ui-test
Open

fix: strict driver teardown makes tests less flappy#1508
DenKoren wants to merge 1 commit intomainfrom
fix/flappy-ui-test

Conversation

@DenKoren
Copy link
Copy Markdown
Member

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 12, 2026

🦋 Changeset detected

Latest commit: 6c1e8cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@milaboratories/pl-drivers Patch
@milaboratories/pl-middle-layer Patch
@platforma-sdk/test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 addresses test flakiness by implementing a more robust and consistent teardown mechanism for the DownloadDriver. By ensuring that all resources are properly released and cleaned up when the driver is disposed, the changes aim to create a more stable testing environment and prevent issues caused by incomplete resource management.

Highlights

  • Improved Driver Teardown: The DownloadDriver now explicitly calls releaseAll() during its dispose() method, ensuring all active and pending downloads are stopped and partially downloaded files are removed.
  • Enhanced Test Stability: This change is aimed at reducing test flakiness by guaranteeing a clean state after driver usage, preventing resource leaks or lingering processes from affecting subsequent tests.
  • Documentation Update: The JSDoc for the releaseAll method in DownloadDriver has been updated to accurately reflect its comprehensive cleanup responsibilities.
Changelog
  • .changeset/eight-places-see.md
    • Added a new changeset file for the @milaboratories/pl-drivers package.
  • lib/node/pl-drivers/src/drivers/download_blob/download_blob.ts
    • Updated the JSDoc for releaseAll method to accurately describe its functionality.
    • Ensured releaseAll is invoked within the dispose method to guarantee comprehensive resource cleanup.
  • tests/workflow-tengo/src/exec/run/hello_go.tpl.tengo
    • Corrected indentation within the exec.builder() call for improved code formatting.
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
Copy Markdown
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 aims to make the driver teardown stricter to reduce test flakiness, primarily by ensuring releaseAll is called during disposal. This is a positive change. The provided comment highlights that the implementation of releaseAll doesn't fully align with its updated, more descriptive documentation, as it currently doesn't abort active downloads or clean up associated partial files. A suggestion has been provided to improve releaseAll to make the teardown process as robust as intended. The other changes in the PR are minor and look fine.

Comment on lines +638 to +639
/** Stops all active downloads, drops all pending (queued) downloads and removes
* all partially downloaded files from storage. */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

This updated documentation is much clearer, but the implementation of releaseAll doesn't seem to fully match it. The function stops the queue but doesn't appear to abort active downloads or remove partially downloaded files.

To align with this comment and ensure a stricter teardown, releaseAll should probably iterate through this.keyToDownload, and for each task, call this.removeTask(). This would ensure tasks are aborted, triggering the cleanup of any partial files and releasing resources correctly.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 54.38%. Comparing base (5e769e4) to head (6c1e8cb).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...drivers/src/drivers/download_blob/download_blob.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1508      +/-   ##
==========================================
- Coverage   54.72%   54.38%   -0.35%     
==========================================
  Files         242      242              
  Lines       13598    13687      +89     
  Branches     2789     2820      +31     
==========================================
+ Hits         7441     7443       +2     
- Misses       5226     5310      +84     
- Partials      931      934       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants