Skip to content

OCPBUGS-77848: [CI] Fix the VolumeSnapshot CRUD flaky test failures#16110

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
cajieh:fix-ci-flaky-tests
Mar 8, 2026
Merged

OCPBUGS-77848: [CI] Fix the VolumeSnapshot CRUD flaky test failures#16110
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
cajieh:fix-ci-flaky-tests

Conversation

@cajieh
Copy link
Contributor

@cajieh cajieh commented Mar 5, 2026

This change aims to resolve the VolumeSnapshot CRUD flaky test failures by addressing the following:

  • Root Cause: Tests are failing on GCP because the necessary CSI StorageClasses are unavailable in that environment.
  • Solution: Skip these specific tests on non-AWS platforms where the feature is not currently supported.
  • Coverage Maintenance: Verification remains intact as dedicated snapshot tests continue to run on AWS (snapshot.cy.ts).
    🤞

Summary by CodeRabbit

  • Tests
    • Improved test reliability by conditionally running VolumeSnapshot-related tests only on AWS platforms, reducing test flakiness on non-AWS environments.

@openshift-ci openshift-ci bot requested review from Leo6Leo and TheRealJon March 5, 2026 12:51
@openshift-ci openshift-ci bot added kind/cypress Related to Cypress e2e integration testing approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 5, 2026
@cajieh cajieh changed the title Fix the VolumeSnapshot CRUD flaky test failures [WIP] OCPBUGS-77848: Fix the VolumeSnapshot CRUD flaky test failures Mar 5, 2026
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 5, 2026
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-77848, which is invalid:

  • expected the bug to target the "4.22.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This change aims to resolve the VolumeSnapshot CRUD flaky test failures by addressing the following:

  • Root Cause: Tests are failing on GCP because the necessary CSI StorageClasses are unavailable in that environment.
  • Solution: Skip these specific tests on non-AWS platforms where the feature is not currently supported.
  • Coverage Maintenance: Verification remains intact as dedicated snapshot tests continue to run on AWS (snapshot.cy.ts).
    🤞

Summary by CodeRabbit

  • Tests
  • Improved test reliability by conditionally running VolumeSnapshot-related tests only on AWS platforms, reducing test flakiness on non-AWS environments.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

This change refactors the Kubernetes resource CRUD test suite to conditionally include VolumeSnapshot-related resources based on the BRIDGE_AWS environment variable. Previously, VolumeSnapshot objects were unconditionally added to the test dataset. The update creates a separate snapshotObjs map that remains empty on non-AWS platforms, then merges it with the primary resource objects to form k8sObjsWithSnapshots. This merged dataset is subsequently used for test object construction, with platform-specific logic handling both standard Kubernetes and OpenShift environments. The change preserves the roles entry and adds clarifying comments regarding AWS-specific reliability concerns.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately reflects the main change: conditionally including VolumeSnapshot resources based on AWS environment to fix flaky CRUD tests, directly addressing the PR's core objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@cajieh
Copy link
Contributor Author

cajieh commented Mar 5, 2026

/jira refresh

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@frontend/packages/integration-tests-cypress/tests/crud/resource-crud.cy.ts`:
- Around line 63-81: The BRIDGE_AWS env check is using Cypress.env('BRIDGE_AWS')
directly, which treats the string "false" as truthy and enables snapshot tests;
update the check used to build snapshotObjs to explicitly normalize the env
value (e.g., treat only the string 'true' as enabled or parse to a boolean) so
snapshotObjs is only populated when BRIDGE_AWS is truly enabled, and ensure the
same normalization is applied where BRIDGE_AWS is read in snapshot.cy.ts and
clone.cy.ts; adjust the conditional that creates snapshotObjs and any merges
into k8sObjsWithSnapshots accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 42aab9e8-0a8f-4c2e-9961-4aa855c28917

📥 Commits

Reviewing files that changed from the base of the PR and between 6035788 and db676e2.

📒 Files selected for processing (1)
  • frontend/packages/integration-tests-cypress/tests/crud/resource-crud.cy.ts

Comment on lines +63 to +81
// VolumeSnapshot tests require CSI-based storage classes which are only reliably available on AWS.
// These resources are thoroughly tested in tests/storage/snapshot.cy.ts on AWS platforms.
// Skip them here to avoid flaky failures on GCP and other platforms.
const snapshotObjs = Cypress.env('BRIDGE_AWS')
? OrderedMap<string, TestDefinition>()
.set('snapshot.storage.k8s.io~v1~VolumeSnapshot', {
kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshot',
})
.set('snapshot.storage.k8s.io~v1~VolumeSnapshotClass', {
kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshotClass',
namespaced: false,
})
.set('snapshot.storage.k8s.io~v1~VolumeSnapshotContent', {
kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshotContent',
namespaced: false,
})
: OrderedMap<string, TestDefinition>();

const k8sObjsWithSnapshots = k8sObjs.merge(snapshotObjs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# Search for BRIDGE_AWS definition and usage across the entire codebase
rg -n "BRIDGE_AWS" --type ts --type js --type json --type yaml

Repository: openshift/console

Length of output: 402


🏁 Script executed:

# Also search for Cypress config and environment setup files
fd -e "cypress" -e "conf" -o "cypress.config" -o ".env" | head -20
git ls-files | grep -i cypress | grep -i config

Repository: openshift/console

Length of output: 1239


🏁 Script executed:

# Check how Cypress.env is used with boolean-like values in tests
rg -n "Cypress\.env\(" --type ts --type js -A2 -B2 | head -100

Repository: openshift/console

Length of output: 12209


🏁 Script executed:

# Check the main cypress config file for how BRIDGE_AWS is configured
cat -n frontend/packages/integration-tests-cypress/cypress.config.js

Repository: openshift/console

Length of output: 1745


🏁 Script executed:

# Also check if there are any CI pipeline configs that set BRIDGE_AWS
git ls-files | grep -E "\.(yml|yaml|groovy|json)$" | xargs rg "BRIDGE_AWS" -l

Repository: openshift/console

Length of output: 45


🏁 Script executed:

# Check the snapshot.cy.ts and clone.cy.ts files to see context around BRIDGE_AWS checks
cat -n frontend/packages/integration-tests-cypress/tests/storage/snapshot.cy.ts | head -30
cat -n frontend/packages/integration-tests-cypress/tests/storage/clone.cy.ts | head -30

Repository: openshift/console

Length of output: 3073


🏁 Script executed:

# Check the plugins/index.js file to see how BRIDGE_AWS is parsed
cat -n frontend/packages/integration-tests-cypress/plugins/index.js | head -100

Repository: openshift/console

Length of output: 2964


🏁 Script executed:

# Also search for any CI configuration files that might set BRIDGE_AWS
git ls-files | xargs rg -l "BRIDGE_AWS" | grep -E "(\.yml|\.yaml|\.groovy|makefile|Makefile|\.sh|script)"

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Search for where BRIDGE_AWS is actually set in the plugins or config
cat -n frontend/packages/integration-tests-cypress/plugins/index.js | tail -20

Repository: openshift/console

Length of output: 1084


🏁 Script executed:

# Search more broadly for BRIDGE_AWS assignment or setup
rg -n "BRIDGE_AWS\s*=" --type js --type ts

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Look at package.json scripts to see how tests are run and env vars passed
cat -n frontend/packages/integration-tests-cypress/package.json | grep -A5 -B5 "BRIDGE_AWS\|cypress"

Repository: openshift/console

Length of output: 284


🏁 Script executed:

# Search across all files for where BRIDGE_AWS is configured
rg -r "config\.env\.BRIDGE_AWS\|process\.env\.BRIDGE_AWS" --type js --type ts

Repository: openshift/console

Length of output: 457


🏁 Script executed:

# Check if BRIDGE_AWS is assigned in the plugin more carefully
cat -n frontend/packages/integration-tests-cypress/plugins/index.js

Repository: openshift/console

Length of output: 2964


🏁 Script executed:

# Search for any reference to BRIDGE_AWS in CI or setup scripts
git ls-files | xargs grep -l "BRIDGE_AWS" 2>/dev/null

Repository: openshift/console

Length of output: 280


🏁 Script executed:

# Double-check by examining how boolean env vars are typically handled in Cypress
rg -n "process\.env\." frontend/packages/integration-tests-cypress/plugins/index.js -A1

Repository: openshift/console

Length of output: 682


🏁 Script executed:

# Verify Cypress behavior with string environment variables
cd frontend/packages/integration-tests-cypress && cat -n support/index.ts | head -50

Repository: openshift/console

Length of output: 1704


🏁 Script executed:

# Verify if BRIDGE_AWS is actually missing from the config assignment
grep -n "config.env.BRIDGE_AWS" frontend/packages/integration-tests-cypress/plugins/index.js

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Check the resource-crud.cy.ts file around line 66 to see the full context
sed -n '60,85p' frontend/packages/integration-tests-cypress/tests/crud/resource-crud.cy.ts

Repository: openshift/console

Length of output: 1261


🏁 Script executed:

# Check how Cypress.env works - does it fall back to process.env if not in config?
rg -n "Cypress\.env\(" frontend/packages/integration-tests-cypress/support/index.ts -A2 -B2

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Look for where BRIDGE_AWS might be passed - check for any env loading logic
find frontend/packages/integration-tests-cypress -name "*.ts" -o -name "*.js" | xargs grep -l "BRIDGE_AWS" | xargs cat | grep -B5 -A5 "BRIDGE_AWS"

Repository: openshift/console

Length of output: 1431


🏁 Script executed:

# Check if there are any other plugin files or setup that might handle BRIDGE_AWS
find frontend/packages/integration-tests-cypress -type f \( -name "*.js" -o -name "*.ts" \) ! -path "*/node_modules/*" | xargs grep -l "BRIDGE_AWS\|config\.env" | head -10

Repository: openshift/console

Length of output: 339


🏁 Script executed:

# Look for CI configuration or test runner setup that might export BRIDGE_AWS
git ls-files | xargs grep -l "BRIDGE_AWS" | xargs cat | head -100

Repository: openshift/console

Length of output: 3909


🏁 Script executed:

# Search for how BRIDGE_AWS is actually passed or configured - maybe it's in environment directly
rg -n "env\|ENV" frontend/packages/integration-tests-cypress/cypress.config.js

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Check if there's any Makefile or test runner that sets environment variables
git ls-files | grep -iE "(makefile|makefile\..*|test\.sh|run\.sh|\.github|\.gitlab)" | head -20

Repository: openshift/console

Length of output: 1021


🏁 Script executed:

# Look for any GitHub Actions or CI config that might set BRIDGE_AWS
git ls-files | grep -E "\.github|\.gitlab|\.circleci" | head -20

Repository: openshift/console

Length of output: 345


🏁 Script executed:

# Check what Cypress.env actually returns - look for any type handling
rg -n "Cypress\.env" frontend/packages/integration-tests-cypress --type ts --type js -B3 -A3 | grep -A3 -B3 "BRIDGE_AWS\|OPENSHIFT_CI\|typeof"

Repository: openshift/console

Length of output: 3384


🏁 Script executed:

# Look at the test.sh to see how BRIDGE_AWS might be passed
cat -n test.sh | grep -i "bridge\|aws\|cypress" -A2 -B2

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Check if Cypress.env falls back to process.env for variables not in config
rg -n "typeof.*Cypress\.env\|String.*Cypress\.env" frontend/packages/integration-tests-cypress --type ts --type js

Repository: openshift/console

Length of output: 43


🏁 Script executed:

# Look for documentation or comments on how BRIDGE_AWS is supposed to be set
rg -n "BRIDGE_AWS" frontend/packages/integration-tests-cypress -B5 -A5 | head -60

Repository: openshift/console

Length of output: 3926


🏁 Script executed:

# Verify Cypress behavior with string env variables - check if Cypress.env() falls back to process.env
rg -n "config\.env\[|config\.env\." frontend/packages/integration-tests-cypress/plugins/index.js | wc -l

Repository: openshift/console

Length of output: 62


🏁 Script executed:

# Count how many env vars are explicitly assigned vs which are missing
cat -n frontend/packages/integration-tests-cypress/plugins/index.js | sed -n '65,71p'

Repository: openshift/console

Length of output: 550


🏁 Script executed:

# Create a simple test to understand: does BRIDGE_AWS appear in any CI/documentation?
rg -r "BRIDGE_AWS" --type md --type txt 2>/dev/null | head -20

Repository: openshift/console

Length of output: 43


Normalize BRIDGE_AWS env check to prevent snapshot tests on non-AWS platforms.

Truthy checks on line 66 and similar locations treat the string "false" as enabled, which reintroduces flaky snapshot tests on GCP/non-AWS runs. Environment variables from CI are always strings, so Cypress.env('BRIDGE_AWS') evaluates to true even when set to "false".

Suggested fix
-  const snapshotObjs = Cypress.env('BRIDGE_AWS')
+  const isAws = String(Cypress.env('BRIDGE_AWS')).toLowerCase() === 'true';
+  const snapshotObjs = isAws
     ? OrderedMap<string, TestDefinition>()
         .set('snapshot.storage.k8s.io~v1~VolumeSnapshot', {
           kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshot',
         })
         .set('snapshot.storage.k8s.io~v1~VolumeSnapshotClass', {
           kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshotClass',
           namespaced: false,
         })
         .set('snapshot.storage.k8s.io~v1~VolumeSnapshotContent', {
           kind: 'snapshot.storage.k8s.io~v1~VolumeSnapshotContent',
           namespaced: false,
         })
     : OrderedMap<string, TestDefinition>();

Also apply the same normalization to snapshot.cy.ts line 13 and clone.cy.ts line 22.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@frontend/packages/integration-tests-cypress/tests/crud/resource-crud.cy.ts`
around lines 63 - 81, The BRIDGE_AWS env check is using
Cypress.env('BRIDGE_AWS') directly, which treats the string "false" as truthy
and enables snapshot tests; update the check used to build snapshotObjs to
explicitly normalize the env value (e.g., treat only the string 'true' as
enabled or parse to a boolean) so snapshotObjs is only populated when BRIDGE_AWS
is truly enabled, and ensure the same normalization is applied where BRIDGE_AWS
is read in snapshot.cy.ts and clone.cy.ts; adjust the conditional that creates
snapshotObjs and any merges into k8sObjsWithSnapshots accordingly.

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Mar 5, 2026
@openshift-ci-robot
Copy link
Contributor

@cajieh: This pull request references Jira Issue OCPBUGS-77848, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @yapei

Details

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested a review from yapei March 5, 2026 12:56
@cajieh cajieh force-pushed the fix-ci-flaky-tests branch from db676e2 to 12741df Compare March 5, 2026 13:14
Copy link
Member

@jhadvig jhadvig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

};

if (Cypress.env('BRIDGE_AWS')) {
// Normalize env check: CI env vars are strings, so "false" would be truthy without explicit comparison.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch 👍

@jhadvig
Copy link
Member

jhadvig commented Mar 5, 2026

Looks like we will need to backport this one

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 5, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cajieh, jhadvig

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cajieh cajieh changed the title [WIP] OCPBUGS-77848: Fix the VolumeSnapshot CRUD flaky test failures OCPBUGS-77848: Fix the VolumeSnapshot CRUD flaky test failures Mar 5, 2026
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 5, 2026
@cajieh cajieh changed the title OCPBUGS-77848: Fix the VolumeSnapshot CRUD flaky test failures OCPBUGS-77848: [CI] Fix the VolumeSnapshot CRUD flaky test failures Mar 5, 2026
@cajieh
Copy link
Contributor Author

cajieh commented Mar 5, 2026

/retest

@cajieh
Copy link
Contributor Author

cajieh commented Mar 5, 2026

/retest e2e-gcp-console

@cajieh
Copy link
Contributor Author

cajieh commented Mar 6, 2026

/test e2e-gcp-console

1 similar comment
@cajieh
Copy link
Contributor Author

cajieh commented Mar 6, 2026

/test e2e-gcp-console

@jhadvig
Copy link
Member

jhadvig commented Mar 6, 2026

c'mon
/woof

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 6, 2026

@jhadvig: dog image

Details

In response to this:

c'mon
/woof

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jhadvig
Copy link
Member

jhadvig commented Mar 6, 2026

Overriding to unblock the merge queue
/overide ci/prow/e2e-gcp-console

@jhadvig
Copy link
Member

jhadvig commented Mar 6, 2026

/verified later @yapei

@openshift-ci-robot openshift-ci-robot added verified-later verified Signifies that the PR passed pre-merge verification criteria labels Mar 6, 2026
@openshift-ci-robot
Copy link
Contributor

@jhadvig: This PR has been marked to be verified later by @yapei.

Details

In response to this:

/verified later @yapei

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@cajieh
Copy link
Contributor Author

cajieh commented Mar 7, 2026

/retest

2 similar comments
@cajieh
Copy link
Contributor Author

cajieh commented Mar 8, 2026

/retest

@logonoff
Copy link
Member

logonoff commented Mar 8, 2026

/retest

@logonoff
Copy link
Member

logonoff commented Mar 8, 2026

/test analyze backend images okd-scos-images frontend

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 8, 2026

@cajieh: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit e1d975d into openshift:main Mar 8, 2026
8 checks passed
@openshift-ci-robot
Copy link
Contributor

@cajieh: Jira Issue OCPBUGS-77848: All pull requests linked via external trackers have merged:

This pull request has the verified-later tag and will need to be manually moved to VERIFIED after testing. Jira Issue OCPBUGS-77848 has been moved to the MODIFIED state.

Details

In response to this:

This change aims to resolve the VolumeSnapshot CRUD flaky test failures by addressing the following:

  • Root Cause: Tests are failing on GCP because the necessary CSI StorageClasses are unavailable in that environment.
  • Solution: Skip these specific tests on non-AWS platforms where the feature is not currently supported.
  • Coverage Maintenance: Verification remains intact as dedicated snapshot tests continue to run on AWS (snapshot.cy.ts).
    🤞

Summary by CodeRabbit

  • Tests
  • Improved test reliability by conditionally running VolumeSnapshot-related tests only on AWS platforms, reducing test flakiness on non-AWS environments.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@cajieh
Copy link
Contributor Author

cajieh commented Mar 8, 2026

/cherry-pick release-4.21

@openshift-cherrypick-robot

@cajieh: new pull request created: #16118

Details

In response to this:

/cherry-pick release-4.21

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/cypress Related to Cypress e2e integration testing lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria verified-later

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants