Skip to content

Commit c6a68dd

Browse files
Siddharth SaladiSiddharth Saladi
authored andcommitted
increase dashboard load timeout
1 parent 6d8875c commit c6a68dd

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/test/shared/devModeTestSuite.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,20 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
7373
logger.testStart('Liberty Tools shows items - Maven');
7474
try {
7575
logger.step(1, 'Getting dashboard section');
76-
const section = await dashboard.getSection();
76+
const section = await dashboard.getSection();
7777
logger.stepSuccess(1, 'Dashboard section retrieved');
7878

7979
logger.step(2, 'Waiting for Liberty Tools to load');
8080
await utils.waitForDashboardToLoad(section);
8181
logger.stepSuccess(2, 'Liberty Tools loaded successfully');
8282

83+
// waitForDashboardToLoad already confirmed items exist on a fresh
84+
// section reference. Re-fetch here so getVisibleItems() doesn't
85+
// operate on the original stale reference from before the wait.
8386
logger.step(3, 'Getting visible items from section');
87+
const freshSection = await dashboard.getSection();
8488
const menu = await utils.waitForCondition(async () => {
85-
const items = await section.getVisibleItems();
89+
const items = await freshSection.getVisibleItems();
8690
if (items && items.length > 0) {
8791
return items;
8892
}
@@ -92,7 +96,7 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
9296
expect(menu).not.empty;
9397

9498
logger.step(4, `Finding Maven project item: ${config.projectConstant}`);
95-
const item = await dashboard.getProjectItem(config.projectConstant);
99+
const item = await dashboard.getProjectItem(config.projectConstant);
96100
logger.stepSuccess(4, 'Maven project item found');
97101
expect(item).not.undefined;
98102

@@ -101,7 +105,7 @@ export function runDevModeTestSuite(config: DevModeConfig): void {
101105
logger.testFailed(`Liberty Tools shows items - ${config.buildTool}`, error);
102106
throw error;
103107
}
104-
}).timeout(275000);
108+
}).timeout(360000);
105109

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

src/test/utils/testUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ export async function waitForDashboardToLoad(section: any): Promise<void> {
551551
}
552552
return;
553553
}, {
554-
timeout: 265000, // stay inside the 275 s Mocha cap on "Liberty Tools shows items"
554+
timeout: 340000, // stay inside the 360 s Mocha cap on "Liberty Tools shows items"
555555
pollInterval: 5000, // check every 5 seconds
556556
message: 'Dashboard items did not load'
557557
});

0 commit comments

Comments
 (0)