Skip to content

Conversation

CsCherrYY
Copy link
Collaborator

Also update vscode engine to 1.66.0 (the first version using node 16)

@CsCherrYY
Copy link
Collaborator Author

CsCherrYY commented Mar 2, 2023

test failed due to VS Code 1.75.0, in the previous versions (includes 1.74.3) it runs successfully, I'll take a look.

@@ -273,6 +273,7 @@ describe(getSuiteName("Gradle daemons"), () => {
.catch(reject);
// This call will return the correct results (longReply)
gradleDaemonsTreeDataProvider.refresh();
await sleep(1000);
Copy link
Member

Choose a reason for hiding this comment

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

what's changed upstream, causing you have to wait 1000ms?

Copy link
Collaborator Author

@CsCherrYY CsCherrYY Mar 2, 2023

Choose a reason for hiding this comment

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

not sure what's changed there, some findings:

  • See the current implementation:

    gradleDaemonsTreeDataProvider.refresh();
    gradleDaemonsTreeDataProvider
    .getChildren()
    .then((_children: vscode.TreeItem[]) => {
    assert.strictEqual(_children[0].description, "BUSY");
    })
    .catch(reject);
    // This call will return the correct results (longReply)
    gradleDaemonsTreeDataProvider.refresh();
    gradleDaemonsTreeDataProvider
    .getChildren()
    .then((_children: vscode.TreeItem[]) => {
    assert.strictEqual(_children[0].description, "IDLE");
    resolve(undefined);
    })
    .catch(reject);

  • this test case aims to test if a "urgent" refresh will skip the running process that fetches the daemon status (called "future result", IDLE here) and return the "current result" (BUSY here).

  • This case includes two parts:

    • part 1: The refresh() call in line 275 will skip the getChildren() call in line 269 to return the "current result",
    • part 2: The getChildren() call in line 277 can finish with "future result" successfully since it will not be interrupted by any refresh() call.
  • when using the original test code and tested in VS Code 1.74.3, the debugger view shows the result is not expected, but the test case passed. Not sure why.
    image
    image

  • So I just sleep here to distinguish two parts, workaround here for now and make it behave more "manually".

@CsCherrYY CsCherrYY merged commit 4fdf19d into develop Mar 3, 2023
@CsCherrYY CsCherrYY deleted the cs-deps-feb branch March 3, 2023 00:33
CsCherrYY added a commit that referenced this pull request Mar 27, 2023
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.

2 participants