You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(amazonq): Addition of wait function for Amazon Q inline chat UI E2E Tests and Inline Keybind Shortcut Test (#7840)
## Problem
Currently we use a `sleep(8000)` function which causes us to wait an
arbitrary 8 seconds for Amazon Q to implement the fibonacci sequence.
This can cause flakiness and is generally not a good practice. We also
have not fully updated our inline test and our writeToTextEditor
function does not work well. We also have not implemented an inline test
which uses keybinds to start an inline chat suggestion.
## Solution
I have implemented a function which constantly checks for a "stable"
state in which we check for any new number of lines generated by Amazon
Q. If this stable state is repeated more than 2 times, meaning the
number of lines has stayed the same for 3 seconds (1 second wait in
between), we will confirm that AmazonQ has finished generating its
response. We have a maximum generate time of 15 seconds, as a fibonacci
sequence should not take more than that, or something is clearly wrong
with the model and we will error out. We have implemented the inline
tests and the writeToTextEditor function fix.
---
- 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.
---------
Co-authored-by: laura-codess <[email protected]>
0 commit comments