Skip to content

WIP: Replace brittle string split with regex for timestamp extraction for OCP-39845#3934

Open
MrSanketkumar wants to merge 2 commits into
openshift:mainfrom
MrSanketkumar:fix-ocp39845-datetime-parse-error
Open

WIP: Replace brittle string split with regex for timestamp extraction for OCP-39845#3934
MrSanketkumar wants to merge 2 commits into
openshift:mainfrom
MrSanketkumar:fix-ocp39845-datetime-parse-error

Conversation

@MrSanketkumar

@MrSanketkumar MrSanketkumar commented Jun 16, 2026

Copy link
Copy Markdown

Problem

OCP-39845 test fails with error:

string length (279) exceeds the limit 128 (ArgumentError)
./features/step_definitions/file.rb:41:in 'parse'

Root Cause:
The test parses machineset-controller logs using .split("Watching") which assumes "Watching" keyword exists in logs. In 4.15/ARM64 builds, this keyword is missing or in a different location, causing the split to return 279 characters of log content instead of a timestamp.

Solution

  • Replace brittle .split("Watching") logic with regex that directly extracts ISO8601 timestamps
  • Add debug logging to help diagnose failures in Prow job console output
  • Improved error messages showing actual vs expected values

Debug Output

The fix includes debug logging that will appear in Prow job console:

DEBUG: split1_old length=279 (shows the problem)
DEBUG: regex match1 found: 2026-06-11T04:10:20Z (shows the fix works)
DEBUG: Time difference = 45 seconds (shows actual timing)

@openshift-ci-robot

Copy link
Copy Markdown

@MrSanketkumar: No Jira issue with key OCP-39845 exists in the tracker at https://redhat.atlassian.net.
Once a valid jira issue is referenced in the title of this pull request, request a refresh with /jira refresh.

Details

In response to this:

Problem

OCP-39845 test fails with error:

string length (279) exceeds the limit 128 (ArgumentError)
./features/step_definitions/file.rb:41:in 'parse'

Root Cause:
The test parses machineset-controller logs using .split("Watching") which assumes "Watching" keyword exists in logs. In 4.15/ARM64 builds, this keyword is missing or in a different location, causing the split to return 279 characters of log content instead of a timestamp.

Solution

  • Replace brittle .split("Watching") logic with regex that directly extracts ISO8601 timestamps
  • Add debug logging to help diagnose failures in Prow job console output
  • Improved error messages showing actual vs expected values

Debug Output

The fix includes debug logging that will appear in Prow job console:

DEBUG: split1_old length=279 (shows the problem)
DEBUG: regex match1 found: 2026-06-11T04:10:20Z (shows the fix works)
DEBUG: Time difference = 45 seconds (shows actual timing)

Testing

Will verify fix by checking debug output in next Prow job run of affected tests.

Fixes test failures in:

  • 4.15 ARM64 upgrade jobs
  • Private cluster + STS configurations
  • Jobs with basecap-none

Related: OCP-39845 ClusterInfrastructure test

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 review from dis016 and pruan-rht June 16, 2026 07:57
@MrSanketkumar MrSanketkumar changed the title Fix OCP-39845: Replace brittle string split with regex for timestamp extraction DNM: OCP-39845 Replace brittle string split with regex for timestamp extraction Jun 16, 2026
@MrSanketkumar

Copy link
Copy Markdown
Author

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 16, 2026
@MrSanketkumar

Copy link
Copy Markdown
Author

/unhold

@openshift-ci openshift-ci Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 16, 2026
@MrSanketkumar MrSanketkumar changed the title DNM: OCP-39845 Replace brittle string split with regex for timestamp extraction [ DNM] : OCP-39845 Replace brittle string split with regex for timestamp extraction Jun 16, 2026
@MrSanketkumar MrSanketkumar changed the title [ DNM] : OCP-39845 Replace brittle string split with regex for timestamp extraction [ DNM ] : OCP-39845 Replace brittle string split with regex for timestamp extraction Jun 16, 2026
@miyadav

miyadav commented Jun 16, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 16, 2026
@openshift-ci

openshift-ci Bot commented Jun 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: miyadav
Once this PR has been reviewed and has the lgtm label, please assign pruan-rht for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-ci

openshift-ci Bot commented Jun 16, 2026

Copy link
Copy Markdown

@MrSanketkumar: 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.

@MrSanketkumar MrSanketkumar changed the title [ DNM ] : OCP-39845 Replace brittle string split with regex for timestamp extraction WIP: OCP-39845 Replace brittle string split with regex for timestamp extraction Jun 16, 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 Jun 16, 2026
@MrSanketkumar MrSanketkumar changed the title WIP: OCP-39845 Replace brittle string split with regex for timestamp extraction WIP: Replace brittle string split with regex for timestamp extraction for OCP-39845 Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants