Skip to content
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

Fix flaky completion test and clean up console #1864

Merged
merged 4 commits into from
Nov 23, 2023
Merged

Conversation

philipp-spiess
Copy link
Contributor

@philipp-spiess philipp-spiess commented Nov 22, 2023

  • Fix flaky inline completion test by making sure we do not trigger a follow up completion after the last action that may or may not be logged
  • Clean up VS Code install noise when the file was already downloaded. Not helpful.
  • Don't spam the console with logging noise when not on CI
  • Prevent completions from showing up after a ; (similar to ) ] })
Screenshot 2023-11-22 at 13 44 24

bliss!

Test plan

  • Run inline completion test a bunch of times and make sure it doesn't fail anymore
  • No more noise in the console

@philipp-spiess philipp-spiess self-assigned this Nov 22, 2023
@@ -184,7 +184,7 @@ async function doGetInlineCompletions(params: InlineCompletionsParams): Promise<
}

// Do not trigger when the last character is a closing symbol
if (triggerKind !== TriggerKind.Manual && /[)\]}]$/.test(currentLinePrefix.trim())) {
if (triggerKind !== TriggerKind.Manual && /[);\]}]$/.test(currentLinePrefix.trim())) {
Copy link
Contributor Author

@philipp-spiess philipp-spiess Nov 22, 2023

Choose a reason for hiding this comment

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

I wanted to sneak this in anyways; If we have a line like this:

foo.bar();

we don't want to trigger a completion regardless of wether we print a semi or not.

Comment on lines +136 to +138
if (process.env.CI === undefined) {
return
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@akalia25 is it okay if this runs only on our CI servers? Otherwise this makes local development a PITA

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, of course! I appreciate you checking 🙇

@@ -123,9 +123,7 @@ export async function run<T>(around: () => Promise<T>): Promise<T> {
}
})

const server = app.listen(SERVER_PORT, () => {
console.log(`Mock server listening on port ${SERVER_PORT}`)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not helpful. Tests should only log something if something fails IMO

@DanTup
Copy link
Contributor

DanTup commented Nov 22, 2023

@philipp-spiess I hadn't gotten to landing it yet, but I have some changes in #1535 (and #1541) to fix some flakes here too. Not sure if you'd seen that - does this PR supersede that, or might we need both?

@philipp-spiess
Copy link
Contributor Author

@DanTup Ahh I’m so sorry, I have completely overlooked your PR. I think with your approach works too to fix the flake. It's a bit bound to the completion provider (Anthropic in this case) because we parse the prompt but otherwise no big deal. I think we can land both fixes with the ; making sure no follow-up completion is ever shown and yours making sure we control which completions are shown. There are a few other goodies in this PR that should make it easier to work with it locally.

@philipp-spiess philipp-spiess enabled auto-merge (squash) November 22, 2023 13:08
@philipp-spiess philipp-spiess merged commit cc46f82 into main Nov 23, 2023
15 checks passed
@philipp-spiess philipp-spiess deleted the ps/fix-flakes branch November 23, 2023 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants