Skip to content

Commit 114a9b1

Browse files
committed
test fixes
1 parent dc399d1 commit 114a9b1

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

frontend/src/__tests__/cypress/cypress/tests/e2e/dataScienceProjects/workbenches/testWorkbenchControlSuite.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ describe('Start, Stop, Launch and Delete a Workbench in RHOAI', () => {
9191

9292
// Stop workbench
9393
cy.step('Stop workbench and validate it has been stopped');
94-
notebookRow.findNotebookStop().click();
94+
notebookRow.findNotebookStopToggle().click();
9595
notebookConfirmModal.findStopWorkbenchButton().click();
9696
notebookRow.expectStatusLabelToBe('Stopped', 120000);
9797

9898
// Restart workbench and confirm initiation
9999
cy.step('Restart workbench and validate it starts successfully');
100-
notebookRow.findNotebookStart().click();
100+
notebookRow.findNotebookStopToggle().click();
101101
notebookRow.expectStatusLabelToBe('Running', 120000);
102102

103103
// Delete workbench

frontend/src/__tests__/cypress/cypress/tests/e2e/settings/hardwareProfiles/testWorkbenchTolerations.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ describe('Workbenches - tolerations tests', () => {
135135
// Stop workbench and verify it stops running
136136
cy.step(`Stop workbench ${testData.workbenchName}`);
137137
const notebookRow = workbenchPage.getNotebookRow(testData.workbenchName);
138-
notebookRow.findNotebookStop().click();
138+
notebookRow.findNotebookStopToggle().click();
139139
notebookConfirmModal.findStopWorkbenchButton().click();
140140
notebookRow.expectStatusLabelToBe('Stopped', 120000);
141141
cy.reload();
@@ -175,7 +175,7 @@ describe('Workbenches - tolerations tests', () => {
175175
// Stop workbench and verify it stops running
176176
cy.step(`Restart workbench ${testData.workbenchName} and validate it has been started`);
177177
const notebookRow = workbenchPage.getNotebookRow(testData.workbenchName);
178-
notebookRow.findNotebookStart().click();
178+
notebookRow.findNotebookStopToggle().click();
179179
notebookRow.expectStatusLabelToBe('Running', 120000);
180180
cy.reload();
181181

frontend/src/__tests__/cypress/cypress/tests/mocked/projects/tabs/workbench.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ describe('Workbench page', () => {
11271127
const notebookRow = workbenchPage.getNotebookRow('Test Notebook');
11281128

11291129
//stop Workbench
1130-
notebookRow.findNotebookStop().click();
1130+
notebookRow.findNotebookStopToggle().click();
11311131
notebookConfirmModal.findStopWorkbenchButton().should('be.enabled');
11321132
cy.interceptK8s(
11331133
NotebookModel,
@@ -1177,7 +1177,7 @@ describe('Workbench page', () => {
11771177
}),
11781178
);
11791179

1180-
notebookRow.findNotebookStart().click();
1180+
notebookRow.findNotebookStopToggle().click();
11811181
notebookRow.findHaveNotebookStatusText().should('have.text', 'Starting');
11821182
notebookRow.findHaveNotebookStatusText().click();
11831183

@@ -1219,7 +1219,7 @@ describe('Workbench page', () => {
12191219
const notebookRow = workbenchPage.getNotebookRow('Notebook with deleted image');
12201220
notebookRow.findNotebookImageAvailability().should('have.text', 'Deleted');
12211221
notebookRow.findHaveNotebookStatusText().should('have.text', 'Stopped');
1222-
notebookRow.findNotebookStart().should('not.be.disabled');
1222+
notebookRow.findNotebookStopToggle().should('not.be.disabled');
12231223
});
12241224

12251225
it('Edit workbench', () => {

frontend/src/pages/modelServing/screens/global/InferenceServiceTableRow.tsx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,26 @@ const InferenceServiceTableRow: React.FC<InferenceServiceTableRowProps> = ({
5757

5858
const modelServingStatus = getModelServingStatus(inferenceService);
5959

60-
const onStart = React.useCallback(() => {
61-
patchInferenceServiceStoppedStatus(inferenceService, 'false').then(refresh);
60+
const onStart = React.useCallback(async () => {
61+
try {
62+
await patchInferenceServiceStoppedStatus(inferenceService, 'false');
63+
refresh();
64+
} catch (e) {
65+
if (e instanceof Error) {
66+
throw new Error(e.message);
67+
}
68+
}
6269
}, [inferenceService, refresh]);
6370

64-
const onStop = React.useCallback(() => {
65-
patchInferenceServiceStoppedStatus(inferenceService, 'true').then(refresh);
71+
const onStop = React.useCallback(async () => {
72+
try {
73+
await patchInferenceServiceStoppedStatus(inferenceService, 'true');
74+
refresh();
75+
} catch (e) {
76+
if (e instanceof Error) {
77+
throw new Error(e.message);
78+
}
79+
}
6680
}, [inferenceService, refresh]);
6781

6882
return (

0 commit comments

Comments
 (0)