Skip to content

Commit 7afa677

Browse files
author
Siddharth Saladi
committed
wait for language server to initialize before starting a test
1 parent 1fc17db commit 7afa677

2 files changed

Lines changed: 12 additions & 12 deletions

File tree

src/test/shared/devModeTestSuite.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,21 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
2424
describe(`Devmode action tests for ${config.buildTool} Project`, () => {
2525

2626
before(async function() {
27-
this.timeout(60000);
27+
this.timeout(300000);
2828

2929
await VSBrowser.instance.openResources(config.getProjectPath());
3030
await VSBrowser.instance.waitForWorkbench();
31-
31+
32+
// Wait for the Liberty LS to initialize before any test runs.
33+
// registerTreeDataProvider is only called after startLangServer
34+
// resolves — without this, waitForDashboardToLoad polls an empty
35+
// tree for minutes on cold mac-previous runners.
36+
await utils.waitForLanguageServerInit(
37+
'Language Support for Liberty',
38+
'Initialized Liberty Language server',
39+
240
40+
);
41+
3242
dashboard = new DashboardPage();
3343
});
3444

src/test/utils/testUtils.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -532,16 +532,6 @@ export async function waitForDashboardToLoad(section: any): Promise<void> {
532532
// Using a stale reference causes ElementNotInteractableError on every
533533
// getVisibleItems() call, looping forever until timeout.
534534
await wait.forCondition(async () => {
535-
// Prod the extension to refresh on every iteration. On cold previous
536-
// runners registerTreeDataProvider is not called until the Liberty LS
537-
// JVM has started (extension.ts registers the tree provider only after
538-
// startLangServer resolves). Executing liberty.explorer.refresh forces
539-
// a repopulation once the provider is registered; before that the
540-
// command simply isn't registered and the error is swallowed.
541-
try {
542-
await new Workbench().executeCommand('liberty.explorer.refresh');
543-
} catch { /* command not yet registered — keep waiting */ }
544-
545535
try {
546536
const freshSection = await getDashboardSection(new SideBarView());
547537
await freshSection.expand();

0 commit comments

Comments
 (0)