Skip to content

Commit 04344a8

Browse files
Siddharth SaladiSiddharth Saladi
authored andcommitted
activate extension before dashboard poll
1 parent c6a68dd commit 04344a8

3 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/test/GradleTestDevModeActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ describe('Gradle-specific devmode action tests', () => {
183183
* Closing the workspace ensures the next test file starts with a clean slate.
184184
*/
185185
after(async function() {
186-
this.timeout(45000);
186+
this.timeout(60000);
187187
await utils.closeWorkspace();
188188
});
189189
});

src/test/shared/devModeTestSuite.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
105105
logger.testFailed(`Liberty Tools shows items - ${config.buildTool}`, error);
106106
throw error;
107107
}
108-
}).timeout(360000);
108+
}).timeout(480000);
109109

110110
it(`Start ${config.buildTool} project from Liberty Tools`, async () => {
111111
logger.testStart('Start Maven project from Liberty Tools');

src/test/utils/testUtils.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,18 @@ export async function waitForDashboardToLoad(section: any): Promise<void> {
526526
const wait = getWaitHelper();
527527
logger.info('Waiting for Liberty Dashboard to load');
528528

529+
// Focus the Liberty Tools view before polling. The extension has an
530+
// "onView:liberty-dev" activation event — explicitly revealing the view
531+
// triggers immediate activation and project scanning instead of waiting
532+
// for the extension host to do it passively, which can take 5+ minutes
533+
// on cold mac-previous runners after a prior heavy devmode suite.
534+
try {
535+
await new Workbench().executeCommand('liberty-dev.focus');
536+
await wait.sleep(1000);
537+
} catch {
538+
// Non-fatal — falls back to the poll loop below if the command fails
539+
}
540+
529541
// Re-fetch a fresh section on every poll iteration. The section reference
530542
// passed in (or obtained just before this call) goes stale on cold runners
531543
// once VS Code rebuilds the sidebar DOM after workspace activation.
@@ -551,7 +563,7 @@ export async function waitForDashboardToLoad(section: any): Promise<void> {
551563
}
552564
return;
553565
}, {
554-
timeout: 340000, // stay inside the 360 s Mocha cap on "Liberty Tools shows items"
566+
timeout: 460000, // stay inside the 480 s Mocha cap on "Liberty Tools shows items"
555567
pollInterval: 5000, // check every 5 seconds
556568
message: 'Dashboard items did not load'
557569
});

0 commit comments

Comments
 (0)