Skip to content

fix(e2e): clear policy exclusions to avoid serialization errors#478

Merged
janisz merged 4 commits intomasterfrom
fix-timeout-test-override
Mar 13, 2026
Merged

fix(e2e): clear policy exclusions to avoid serialization errors#478
janisz merged 4 commits intomasterfrom
fix-timeout-test-override

Conversation

@janisz
Copy link
Contributor

@janisz janisz commented Mar 13, 2026

When retrieving a policy from the API and updating it, the exclusions may contain null scope values that cause Gson serialization errors: "Not a JSON Object: null" at StorageScope serialization.

This fix clears the exclusions array before updating the policy to avoid the serialization issue while still allowing the tests to modify enforcement actions and policy fields.

Also remove flaky timeout test as it's failing randomly when scan is faster then the timeout.

The ImageScanningTestNoFileTest overrode getJobConfig but was missing
the readTimeoutSeconds parameter. This caused the timeout test to call
the parent method instead, making it use createJobConfig() rather than
createJobConfigNoFile(), which resulted in test failure.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@janisz janisz requested a review from rhybrillou as a code owner March 13, 2026 09:35
janisz and others added 3 commits March 13, 2026 10:37
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The timeout test is environment-dependent and fragile because it relies
on external infrastructure being slow enough to trigger a timeout with a
1-second limit. This makes it unreliable in CI environments with varying
network speeds and API response times.

The readTimeoutSeconds parameter support remains in place as it's still
a useful configuration option for the Jenkins plugin.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
When retrieving a policy from the API and updating it, the exclusions
may contain null scope values that cause Gson serialization errors:
"Not a JSON Object: null" at StorageScope serialization.

This fix clears the exclusions array before updating the policy to
avoid the serialization issue while still allowing the tests to
modify enforcement actions and policy fields.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Tomasz Janiszewski <tomek@redhat.com>
@janisz janisz force-pushed the fix-timeout-test-override branch from e4a0408 to afa58af Compare March 13, 2026 13:49
@janisz janisz changed the title fix: add missing readTimeoutSeconds parameter to test override fix(e2e): clear policy exclusions to avoid serialization errors Mar 13, 2026
@janisz janisz merged commit b23bfa1 into master Mar 13, 2026
5 of 6 checks passed
@janisz janisz deleted the fix-timeout-test-override branch March 13, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants