From: Stephen Smith Date: Fri, 24 Jun 2022 12:54:11 +0000 (-0400) Subject: Merge branch '19093-process-failed-warning' into main. Closes #19093 X-Git-Tag: 2.5.0~48 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/2454ac35292a79594c32a80430740317ed5005cf?hp=cb2699f27ab6ea2587b7842e28cbd0941ea03535 Merge branch '19093-process-failed-warning' into main. Closes #19093 Arvados-DCO-1.1-Signed-off-by: Stephen Smith --- diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index fd8e65b2..28454a90 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -374,7 +374,7 @@ describe('Collection panel tests', function () { cy.goToPath(`/collections/${this.testCollection.uuid}`); ['subdir', 'G%C3%BCnter\'s%20file', 'table%&?*2'].forEach((subdir) => { - cy.get('[data-cy=collection-files-panel]') + cy.waitForDom().get('[data-cy=collection-files-panel]') .contains('bar').rightclick(); cy.get('[data-cy=context-menu]') .contains('Rename') @@ -642,7 +642,7 @@ describe('Collection panel tests', function () { .contains(projName).and('contain', testProject.uuid); // Double check that the collection is in the project cy.goToPath(`/projects/${testProject.uuid}`); - cy.get('[data-cy=project-panel]').should('contain', collName); + cy.waitForDom().get('[data-cy=project-panel]').should('contain', collName); }); }); diff --git a/cypress/integration/process.spec.js b/cypress/integration/process.spec.js index 48b936cf..faf70c49 100644 --- a/cypress/integration/process.spec.js +++ b/cypress/integration/process.spec.js @@ -244,5 +244,27 @@ describe('Process tests', function() { .should('contain', 'Free disk space is low') .and('contain', 'No additional warning details available'); }); + + + // Force container_count for testing + let containerCount = 2; + cy.intercept({method: 'GET', url: '**/arvados/v1/container_requests/*'}, (req) => { + req.reply((res) => { + res.body.container_count = containerCount; + }); + }); + + cy.getAll('@containerRequest').then(function([containerRequest]) { + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get('[data-cy=process-runtime-status-retry-warning]') + .should('contain', 'Process retried 1 time'); + }); + + cy.getAll('@containerRequest').then(function([containerRequest]) { + containerCount = 3; + cy.goToPath(`/processes/${containerRequest.uuid}`); + cy.get('[data-cy=process-runtime-status-retry-warning]') + .should('contain', 'Process retried 2 times'); + }); }); }); diff --git a/src/views-components/process-runtime-status/process-runtime-status.tsx b/src/views-components/process-runtime-status/process-runtime-status.tsx index 3858e49e..3b5fae36 100644 --- a/src/views-components/process-runtime-status/process-runtime-status.tsx +++ b/src/views-components/process-runtime-status/process-runtime-status.tsx @@ -7,6 +7,7 @@ import { ExpansionPanel, ExpansionPanelDetails, ExpansionPanelSummary, + Paper, StyleRulesCallback, Typography, withStyles, @@ -26,7 +27,8 @@ type CssRules = 'root' | 'error' | 'errorColor' | 'warning' - | 'warningColor'; + | 'warningColor' + | 'paperRoot'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { @@ -65,15 +67,21 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ warningColor: { color: theme.customs.colors.yellow900, }, + paperRoot: { + minHeight: theme.spacing.unit * 6, + display: 'flex', + alignItems: 'center', + }, }); export interface ProcessRuntimeStatusDataProps { runtimeStatus: RuntimeStatus | undefined; + containerCount: number; } type ProcessRuntimeStatusProps = ProcessRuntimeStatusDataProps & WithStyles; export const ProcessRuntimeStatus = withStyles(styles)( - ({ runtimeStatus, classes }: ProcessRuntimeStatusProps) => { + ({ runtimeStatus, containerCount, classes }: ProcessRuntimeStatusProps) => { return
{ runtimeStatus?.error &&
@@ -103,5 +111,14 @@ export const ProcessRuntimeStatus = withStyles(styles)(
} + { containerCount > 1 && +
+ + + {`Warning: Process retried ${containerCount - 1} time${containerCount > 2 ? 's' : ''} due to failure.`} + + +
+ }
-}); \ No newline at end of file +}); diff --git a/src/views/process-panel/process-details-attributes.tsx b/src/views/process-panel/process-details-attributes.tsx index 1e3e5591..4af2c9cd 100644 --- a/src/views/process-panel/process-details-attributes.tsx +++ b/src/views/process-panel/process-details-attributes.tsx @@ -64,7 +64,7 @@ export const ProcessDetailsAttributes = withStyles(styles, { withTheme: true })( const mdSize = props.twoCol ? 6 : 12; return - + {!props.hideProcessPanelRedundantFields &&