Commit 9b873dc
authored
test(amazonq): reduce flakiness by avoiding unnecessary fs operations. (aws#7259)
## Problem
This test has been very flaky, and constantly failing CI
(aws#7187).
This test is run for almost 40 different cases, and does the following:
- create a text document
- write it to the filesystem.
- run the check on the text document.
One of the core issues is that when we write the text document to the
filesystem, we create a new test workspace folder for each case. This
involves creating a directory with a random id for each of the almost 40
different cases.
These excessive file system operations could be leading to the flakiness
in CI.
## Solution
- reuse the same test workspace folder across all test cases. This
should cut the file systems operations in half.
## Future Work
- If this doesn't reduce flakiness, we could avoid writing the text
document to the fs since its not needed by the underlying test, but this
involves mocking the text document which is undesirable imo.
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.1 parent 0b169a8 commit 9b873dc
File tree
1 file changed
+7
-3
lines changed- packages/amazonq/test/unit/codewhisperer/util
1 file changed
+7
-3
lines changedLines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
113 | | - | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
0 commit comments