sourcegraph / cody

Type less, code more: Cody is an AI code assistant that uses advanced search and codebase context to help you write and fix code.
https://cody.dev
Apache License 2.0
2.6k stars 278 forks source link

Revert "fix symf instanceof CancellationError test flake (#4574)" #4588

Closed olafurpg closed 3 months ago

olafurpg commented 3 months ago

This reverts commit 8ac4a7a. This commit made the tests flaky. Instead of removing usage of CancellationError, we implement this class in the mocks instead.

Test plan

Non-flaky green CI

olafurpg commented 3 months ago

Closing since I'm still seeing the same CI failure

 FAIL  |agent| src/index.test.ts > Agent > Text documents > chat/submitMessage (understands the selected text)
AssertionError: the given combination of arguments (undefined and string) is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a string
 ❯ src/index.test.ts:649:41
    647|                 { addEnhancedContext: true }
    648|             )
    649|             expect(reply?.text?.trim()).includes('anotherFunction')
       |                                         ^
    650|             expect(reply?.text?.trim()).not.includes('inner')
    651|             await client.changeFile(multipleSelectionsUri)
dominiccooney commented 3 months ago

@olafurpg assuming we want this closed... closing.

olafurpg commented 3 months ago

@dominiccooney yes, sorry, this PR should be closed