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

Test "Antora support with single documentation component" is flaky #856

Open
ViToni opened this issue Mar 17, 2024 · 1 comment
Open

Test "Antora support with single documentation component" is flaky #856

ViToni opened this issue Mar 17, 2024 · 1 comment
Labels

Comments

@ViToni
Copy link
Contributor

ViToni commented Mar 17, 2024

Hit the issue only once locally and once in a pipeline but still unexpected:

  • What you're trying to do: Executing npm run test on master
  • What happened: Test is flaky:
  1) Antora support with single documentation component
       Should build content catalog:
     TypeError: Cannot read properties of undefined (reading 'getImages')
  	at /Users/vtoni/git/asciidoctor-vscode/dist/src/test/antoraSupport.test.js:219:35
  	at Generator.next (<anonymous>)
  	at fulfilled (dist/src/test/antoraSupport.test.js:28:58)

Re-executing npm run test doesn't hit the failing test

  • What you expected to happen: Test should be stable

I've seen the test also fail in a Windows pipeline (not master, feature branch with unrelated changes):

System Info
Commit: acbb890
Date: 2024-03-17T19:45+01:00
Node.js: 18.14.2
OS: MacOS Sonoma 14.4

@ggrossetie
Copy link
Member

The following function returns undefined:

export async function getAntoraDocumentContext (textDocumentUri: Uri, workspaceState: Memento): Promise<AntoraDocumentContext | undefined> {

Since there's no error in the console, antoraSupportManager.isEnabled() might return false:

if (!antoraSupportManager.isEnabled()) {
return undefined
}

Or we cannot find an Antora context for the given file:

if (antoraResourceContext === undefined) {
return undefined
}

We should probably add a logger to help troubleshoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants