Skip to content

Debug test flakes #1131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Debug test flakes #1131

merged 1 commit into from
Feb 24, 2025

Conversation

cte
Copy link
Collaborator

@cte cte commented Feb 23, 2025

Description

We need a way to await Cline tasks and abort them when necessary for our tests.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Enhances Cline class with task initialization and abandonment handling, updates tests for image handling and API retries, and removes a test timeout.

  • Cline Class:
    • Adds create() method to Cline for task initialization, allowing tasks to be started without immediately executing them.
    • Modifies abortTask() to handle isAbandoned parameter, marking tasks as abandoned.
    • Updates task start logic to check startTask flag.
  • Tests:
    • Updates Cline.test.ts to use Cline.create() for task initialization.
    • Adds handling for image blocks based on model capabilities in Cline.test.ts.
    • Implements API retry logic with countdown in Cline.test.ts.
    • Removes timeout from applyGitFallback tests in edit-strategies.test.ts.

This description was created by Ellipsis for 40a86b1. It will automatically update as commits are pushed.

@cte cte requested a review from mrubens as a code owner February 23, 2025 17:19
Copy link

changeset-bot bot commented Feb 23, 2025

⚠️ No Changeset found

Latest commit: 40a86b1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Feb 23, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. size:L This PR changes 100-499 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. size:M This PR changes 30-99 lines, ignoring generated files. labels Feb 23, 2025
@cte cte changed the title [WIP] Debug tests Debug test flakes Feb 24, 2025
Comment on lines +169 to +176
args[10] = false // startTask
const instance = new Cline(...args)

let task

if (args[6] || args[7]) {
task = instance.startTask(args[6], args[7])
} else if (args[8]) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These hardcoded indexes feel pretty fragile / easy for us to forget about next time we add a param to the constructor. Think there's anything we could do to keep them in sync? Maybe a comment at the very least?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The "right" solution seems like using an actual type. I can do that as a follow-up right now; most of the new Cline() calls are in tests so it should be pretty safe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also, this is only used by tests at the moment, so I don't think we're risking breaking much in the meantime.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 24, 2025
@cte cte merged commit 9dbfeef into main Feb 24, 2025
11 checks passed
@cte cte deleted the cte/debug-tests branch February 24, 2025 05:40
@cte cte mentioned this pull request Feb 24, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants