Skip to content

ROX-12956: Increase requestTimeout and disable colors for integration tests#3307

Merged
pedrottimark merged 2 commits intomasterfrom
ROX-12956-cypress-requestTimeout-NO_COLOR
Oct 5, 2022
Merged

ROX-12956: Increase requestTimeout and disable colors for integration tests#3307
pedrottimark merged 2 commits intomasterfrom
ROX-12956-cypress-requestTimeout-NO_COLOR

Conversation

@pedrottimark
Copy link
Contributor

@pedrottimark pedrottimark commented Oct 4, 2022

Description

Test failure

  1. 1576986632538558464 from master build for Re-org migration conversion tool #3272 on 2022-10-03

Policy wizard, Step 3 Policy Criteria Existing values should populate select dropdown

cy.wait() timed out waiting 5000ms for the 1st request to the route: credentialexpiry_CENTRAL. No request ever occurred.

prow

cypress/integration/policies/policyWizardStep3.test.js

Unlike featureflags or mypermissions, this generic request does not block rendering the page. The page renders spinner because waiting for its requests.

Analysis

This is the third investigation to examine the build-log.text file. The second was in #3268

Compare 5 occurrences of Refreshing the GKE auth token. TL;DR see 4 below

  1. During video processing and docs.test.js which is an external link which does not have API requests.

    INFO: Mon Oct  3 18:12:35 UTC 2022: Refreshing the GKE auth token
       -  Finished processing: /go/src/github.com/stackrox/stackrox/ui/test-results/artifa    (4 seconds)
                               cts/videos/certexpiration.test.js.mp4                                     
     ────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                         
       Running:  docs.test.js                                                                   (4 of 82)
     
       Documentation Access
    Fetching cluster endpoint and auth data.
         ✓ should load the documentation page
       1 passing (2s)
    kubeconfig entry generated for rox-ci-ui-e2e-test-1576986632538558464.
    
  2. During video processing and maybe after the last test had finished.

        ✓ should have the same number of Deployments in the count widget as in the Deployments table (10756ms)
    INFO: Mon Oct  3 18:27:44 UTC 2022: Refreshing the GKE auth token
        ✓ should allow user to drill down from cluster to image to image-deployments
    8 passing (30s)
    (Results)
    ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
    │ Tests:        8                                                                                │
    │ Passing:      8                                                                                │
    │ Failing:      0                                                                                │
    │ Pending:      0                                                                                │
    │ Skipped:      0                                                                                │
    │ Screenshots:  0                                                                                │
    │ Video:        true                                                                             │
    │ Duration:     29 seconds                                                                       │
    │ Spec Ran:     images.test.js                                                                   │
    └────────────────────────────────────────────────────────────────────────────────────────────────┘
    (Video)
    -  Started processing:  Compressing to 32 CRF                                                     
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for rox-ci-ui-e2e-test-1576986632538558464.
    
  3. Maybe before the first test had started.

    Signature Integrations Test
    INFO: Mon Oct  3 18:42:53 UTC 2022: Refreshing the GKE auth token
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for rox-ci-ui-e2e-test-1576986632538558464.
        ✓ should create a new signature integration (41533ms)
    
  4. Bingo! picture above is for should populate select dropdown

        Existing values
        ✓ should populate boolean radio buttons (8340ms)
    INFO: Mon Oct  3 18:58:06 UTC 2022: Refreshing the GKE auth token
        ✓ should populate string radio buttons (10395ms)
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for rox-ci-ui-e2e-test-1576986632538558464.
        ✓ should populate text input (10999ms)
        1) should populate select dropdown
        ✓ should populate multiselect dropdown (10035ms)
        ✓ should populate policy field input nested group (10960ms)
    27 passing (7m)
    1 failing
    
  5. During video processing between test files.

    -  Started processing:  Compressing to 32 CRF                                                     
    INFO: Mon Oct  3 19:13:20 UTC 2022: Refreshing the GKE auth token
    -  Finished processing: /go/src/github.com/stackrox/stackrox/ui/test-results/artifa    (5 seconds)
                            cts/videos/vulnmanagement/namespacesListPages.test.js.mp4                 
    ────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                        
    Running:  nodeComponentsListPages.test.js                                               (73 of 82)
    Fetching cluster endpoint and auth data.
    kubeconfig entry generated for rox-ci-ui-e2e-test-1576986632538558464.
    

Solution

After having added intercept-interact-wait sandwiches for test-specific requests to vulnmanagement and configmanagement, the last containers that lacked the pattern, this policies test already has up-to-date helper functions.

The next step to improve reliability is increase timeout for all requests.

  1. Edit scripts/cypress.sh

    To simplify search and eliminate editing, disable color in cypress output to build-log.txt file.

    If you want colors to be disabled, you can pass the NO_COLOR environment variable to disable colors. You may want to do this if ASCII characters or colors are not properly formatted in your CI.

    https://docs.cypress.io/guides/continuous-integration/introduction#Colors

  2. Edit cypress.config.js

    Double requestTimeout from 5000 to 10000 milliseconds.

    requestTimeout default 5000 Time, in milliseconds, to wait until a response

    https://docs.cypress.io/guides/references/configuration#Timeouts

  3. Delete waitOptions because default responseTimeout is 30000

    • Edit cypress/helpers/compliance.js
    • Edit cypress/helpers/configWorkflowUtils.js

Checklist

  • Investigated and inspected CI test results
  • Edited integration tests

Testing Performed

@ghost
Copy link

ghost commented Oct 4, 2022

Images are ready for the commit at 05adf5c.

To use with deploy scripts, first export MAIN_IMAGE_TAG=3.72.x-217-g05adf5c7c2.

@pedrottimark pedrottimark requested a review from vjwilson October 4, 2022 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants