Skip to content

Conversation

@Shrinath-O2
Copy link
Contributor

Summary

  • Add unique testRunId to pattern and stream names for test isolation during parallel execution
  • Add retry logic to checkPatternExists for backend indexing delays (3 attempts with 2s wait)
  • Add search box filtering in selectStream for reliable stream selection in long lists
  • Add retry logic for Stream Detail button in stream association page
  • Fix ingestion retry with exponential backoff for "stream being deleted" errors
  • Update regexPatternManagement test with unique pattern names to avoid conflicts

Test plan

  • All 23 SDR tests pass reliably in parallel execution
  • Verified tests pass when run individually and as a suite
  • No regressions in other test suites

…cution

- Add unique run ID and worker index to stream names to prevent conflicts
- Pipeline conditions tests now use `e2e_conditions_*_<runId>_w<idx>` pattern
- Schemaload tests now use `stress_test_<runId>_w<idx>` pattern
- Add stream deletion verification methods to apiCleanup.js
- Fix networkidle timeouts in schemaLoadPage.js with non-blocking waits
- Remove redundant data ingestion from pipeline-conditions test bodies
- Update cleanup.spec.js comments to reflect new naming strategy

This fixes "stream is being deleted" errors that occurred when parallel
tests competed for shared stream names, or when streams from previous
test runs were still being deleted asynchronously.
- Add unique testRunId to pattern and stream names for test isolation
- Add retry logic to checkPatternExists for backend indexing delays
- Add search box filtering in selectStream for reliable stream selection
- Add retry logic for Stream Detail button in stream association page
- Fix ingestion retry with exponential backoff for "stream being deleted" errors
- Update regexPatternManagement test with unique pattern names

All 23 SDR tests now pass reliably in parallel execution.
@Shrinath-O2 Shrinath-O2 added this to the v0.40.0 milestone Dec 13, 2025
- Add unique testRunId to pattern and stream names for test isolation
- Add retry logic to checkPatternExists for backend indexing delays
- Add search box filtering in selectStream for reliable stream selection
- Add retry logic for Stream Detail button in stream association page
- Fix ingestion retry with exponential backoff for "stream being deleted" errors
- Update regexPatternManagement test with unique pattern names

All 23 SDR tests now pass reliably in parallel execution.
@github-actions
Copy link
Contributor

Failed to generate code suggestions for PR

@github-actions github-actions bot added ☢️ Bug Something isn't working 🧹 Updates labels Dec 13, 2025
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 13, 2025

Greptile Overview

Greptile Summary

This PR improves SDR (Sensitive Data Redaction) E2E test reliability by adding test isolation and retry logic to handle parallel execution and backend timing issues.

  • Added unique testRunId (based on timestamp) to pattern and stream names across all SDR tests, preventing conflicts when tests run in parallel
  • Introduced retry logic with exponential backoff in ingestMultipleFields and ingestSingleLog functions to handle "stream being deleted" errors
  • Added waitForStreamAvailable API check before UI stream selection, with fallback retries
  • Enhanced selectStream with search box filtering and scroll-based navigation for reliable stream selection in long lists
  • Added retry logic to checkPatternExists (3 attempts with 2s wait) and Stream Detail button detection
  • Changed navigation methods to use direct URL navigation with dynamic org_identifier instead of clicking through UI elements
  • Fixed a template literal bug in iamPage.js where ${emailName} wasn't being interpolated
  • Consolidated duplicate ingestMultipleFields helper function into logsPage.js page object
  • Updated API URL patterns across multiple spec files to use dynamic ORGNAME instead of hardcoded 'default'
  • Enhanced apiCleanup.js with prefix-based pattern matching and new SDR cleanup methods

Confidence Score: 5/5

  • This PR is safe to merge - it only modifies E2E test infrastructure with no changes to production code.
  • The changes are limited to test files and test page objects. They add retry logic and test isolation patterns that improve test reliability without affecting production code. The code changes are well-structured and follow existing patterns in the codebase.
  • No files require special attention - all changes are in test infrastructure.

Important Files Changed

File Analysis

Filename Score Overview
tests/ui-testing/pages/apiCleanup.js 5/5 Added SDR cleanup methods and enhanced regex pattern cleanup with prefix-based matching for test isolation.
tests/ui-testing/pages/logsPages/logsPage.js 5/5 Added waitForStreamAvailable, enhanced selectStream with retries and search filtering, added ingestMultipleFields with retry logic, and updated API URLs to use dynamic org.
tests/ui-testing/pages/sdrPages/sdrPatternsPage.js 5/5 Changed navigation to use direct URL, simplified file import logic, and added retry logic to checkPatternExists for backend indexing delays.
tests/ui-testing/pages/streamsPages/streamAssociationPage.js 5/5 Changed navigation to use direct URL and added retry logic for Stream Detail button visibility.
tests/ui-testing/playwright-tests/SDR/ingestionTimeDrop.spec.js 5/5 Removed duplicate ingestMultipleFields function, added testRunId for isolation, moved pattern definitions inline, and switched to pm.logsPage.ingestMultipleFields.
tests/ui-testing/playwright-tests/SDR/multipleSDRPatterns.spec.js 5/5 Major refactor: removed import dependency, added testRunId for isolation, patterns created directly instead of imported, added retry logic to ingestSingleLog, extended test timeout to 5 minutes.

Sequence Diagram

sequenceDiagram
    participant Test as SDR Test
    participant LogsPage as logsPage.js
    participant API as Backend API
    participant UI as UI Components
    
    Test->>LogsPage: ingestMultipleFields(streamName, data)
    loop Retry up to 5 times
        LogsPage->>API: POST /api/{org}/{stream}/_json
        alt Success (200)
            API-->>LogsPage: OK
            LogsPage->>LogsPage: Wait 5s for indexing
        else "Stream being deleted" error
            API-->>LogsPage: Error
            LogsPage->>LogsPage: Exponential backoff wait
        end
    end
    
    Test->>LogsPage: selectStream(streamName)
    LogsPage->>API: GET /api/{org}/streams (waitForStreamAvailable)
    loop Poll until found or timeout
        API-->>LogsPage: Stream list
        LogsPage->>LogsPage: Check if stream exists
    end
    
    LogsPage->>UI: Navigate to logs URL
    loop Retry up to 3 times
        LogsPage->>UI: Click dropdown, search, scroll
        alt Stream found
            UI-->>LogsPage: Stream selected
        else Not found
            LogsPage->>UI: Escape, wait 5s, retry
        end
    end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

12 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Move the ingestMultipleFields function from 6 SDR spec files into the
shared logsPage.js page object to eliminate code duplication.
- Update navigateToRegexPatterns and navigateToStreams to use direct URL
  navigation with process.env.ORGNAME
- Fix hardcoded /api/default/ patterns in response URL matching to use
  dynamic org name
- Update apiCleanup regex pattern cleanup to use prefix matching for
  patterns with unique test suffixes
- Improve importPatternsFromFile to verify patterns exist on page
  instead of relying on snackbar message

🤖 Generated with [Claude Code](https://claude.com/claude-code)
- Add unique testRunId suffix to pattern names and stream name
- Make test fully self-contained (creates own patterns instead of importing)
- Extend timeout to 5 minutes for the 10-step sequential test
- Simplify importPatternsFromFile in sdrPatternsPage.js
Add prefixes for SDR test patterns that were not being cleaned up:
- duplicate_test_ (regexPatternManagement.spec.js)
- log_filename_, time_hh_mm_ss_, ifsc_code_, date_dd_mm_yyyy_ (multipleSDRPatterns.spec.js)
- email_format_, us_phone_, credit_card_, ssn_ (other SDR tests)
@Shrinath-O2
Copy link
Contributor Author

@greptileai

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

16 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Fix stats.startTime type mismatch error by using latest tdpw version
which handles numeric timestamps from Playwright reports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☢️ Bug Something isn't working 🧹 Updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants