-
Notifications
You must be signed in to change notification settings - Fork 298
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agent: reset server environment between tests (#2825)
Followup to #2821 Previously, each agent test performed side effects like opening a document that leaked into the next test case. This caused subtle problems like seemingly non-deterministic behavior based on whether you ran an individual test with `it.only` (or `vitest -t`) or all tests. For example, if one test case customized the LLM model then the next test case would use that custom model when running all test together, but the next test would use the default model when running isolated (via `it.only` or `vitest -t`). This PR fixes the problem by adding a new `testing/reset` request that does a best-effort to reset the environment of the server process between each test case. The current implementation may not reset everything perfectly but it solved the problem of the LLM default along with a few other low-hanging cases (open documents). ## Test plan Green CI. Optionally, run the tests locally with `it.only` changes to any test. It should always pass in replay mode now. <!-- Required. See https://sourcegraph.com/docs/dev/background-information/testing_principles. -->
- Loading branch information
Showing
9 changed files
with
5,671 additions
and
121 deletions.
There are no files selected for viewing
5,526 changes: 5,526 additions & 0 deletions
5,526
agent/recordings/defaultClient_631904893/recording.har.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.