Skip to content

fix: prevent cifmw_validations_xml_filter hang#3993

Open
hgoelredhat wants to merge 4 commits into
mainfrom
openstack
Open

fix: prevent cifmw_validations_xml_filter hang#3993
hgoelredhat wants to merge 4 commits into
mainfrom
openstack

Conversation

@hgoelredhat

@hgoelredhat hgoelredhat commented Jun 12, 2026

Copy link
Copy Markdown

fix: prevent cifmw_validations_xml_filter hang

Issue: The validations playbook was hanging indefinitely when
creating JUnit XML files for validation results.

Root cause: ET.tostring() with encoding='utf-8' returned bytes,
which Ansible's copy module couldn't serialize in a template
context, causing an indefinite hang.

Solution: Changed encoding parameter to 'unicode', which returns
str directly, allowing Ansible to process it normally.

Verification:

  • Playbook completes successfully in 1.16 seconds
  • XML file is generated correctly
  • No breaking changes (fully backward compatible)"

Issue: The validations playbook was hanging indefinitely when
creating JUnit XML files for validation results.

Root cause: ET.tostring() with encoding='utf-8' returned bytes,
which Ansible's copy module couldn't serialize in a template
context, causing an indefinite hang.

Solution: Changed encoding parameter to 'unicode', which returns
str directly, allowing Ansible to process it normally.

Verification:
- Playbook completes successfully in 1.16 seconds
- XML file is generated correctly
- No breaking changes (fully backward compatible)

@rebtoor rebtoor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I left a comment to remove the galaxy.yml change that doesn't belong to this patch.

Also, how can we be sure that this will fix the error? Have you tried to reproduce the error using a malformed file? What was the result in that case?

That's why creating a test, with molecule or with unit tests is crucial here.

Also: 2 tests are failing.

  1. this is failing since you're changing the validation role so you should prefix your commit message with [validations].
  2. this is telling you that you should sign-off your commit (git commit -s).

Comment thread galaxy.yml Outdated
@openshift-ci

openshift-ci Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign drosenfe 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

Issue: The validations playbook was hanging indefinitely when
creating JUnit XML files for validation results.

Root cause: ET.tostring() with encoding='utf-8' returned bytes,
which Ansible's copy module couldn't serialize in a template
context, causing an indefinite hang.

Solution: Changed encoding parameter to 'unicode', which returns
str directly, allowing Ansible to process it normally.

Verification:
- Playbook completes successfully in 1.16 seconds
- XML file is generated correctly
- No breaking changes (fully backward compatible)

Signed-off-by: Harshita Goel <hgoel@redhat.com>
Add comprehensive unit tests to verify the hang fix and robustness:
- Test that filter returns str (not bytes) - critical for the fix
- Test empty, single, and multiple test cases
- Test malformed input (missing fields, long errors, special chars)
- Test XML validity and proper escaping
- Test with 100+ test cases to ensure performance

Signed-off-by: Harshita Goel <hgoel@redhat.com>
@hgoelredhat

Copy link
Copy Markdown
Author

@rebtoor
that galaxy commit was back from may that i didnt notice. i have reverted that.
also added test.
can u take a look

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/1d70639615e54e819aef41c3b1b8a0a5

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 01m 56s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 24m 59s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 40m 52s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 23s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 04s
cifmw-pod-pre-commit FAILURE in 8m 45s
✔️ cifmw-molecule-validations SUCCESS in 4m 45s

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants