Skip to content

Commit ff381d8

Browse files
wenytang-msCopilot
andcommitted
fix: retry finding Java Projects section on Linux CI
The javaProjectExplorer.focus command may not render the section immediately on Linux. Add retry loop with re-issuing the command. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 82299ea commit ff381d8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/ui/command.test.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,19 @@ describe("Command Tests", function() {
9999

100100
it("Test javaProjectExplorer.focus", async function() {
101101
await new Workbench().executeCommand("javaProjectExplorer.focus");
102-
const section = await new SideBarView().getContent().getSection("Java Projects");
103-
assert.ok(section.isExpanded(), `Section "Java Projects" should be expanded`);
102+
// Retry finding the section since it may take time to render after the command
103+
let section: ViewSection | undefined;
104+
for (let i = 0; i < 5; i++) {
105+
try {
106+
section = await new SideBarView().getContent().getSection("Java Projects");
107+
break;
108+
} catch (_e) {
109+
await sleep(2000);
110+
await new Workbench().executeCommand("javaProjectExplorer.focus");
111+
}
112+
}
113+
assert.ok(section, `Section "Java Projects" should be found`);
114+
assert.ok(section!.isExpanded(), `Section "Java Projects" should be expanded`);
104115
});
105116

106117
(platform() === "darwin" ? it.skip : it)("Test java.view.package.linkWithFolderExplorer", async function() {

0 commit comments

Comments
 (0)