Skip to content

fix: flaky MultiVersionCRDIT #1761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@ class MultiVersionCRDIT {
.build();

private static class TestInformerStoppedHandler implements InformerStoppedHandler {
private String resourceClassName;
private String resourceCreateAsVersion;
private volatile String resourceClassName;
private volatile String resourceCreateAsVersion;

private String failedResourceVersion;
private String errorMessage;
private volatile String failedResourceVersion;
private volatile String errorMessage;

public void reset() {
resourceClassName = null;
resourceCreateAsVersion = null;
failedResourceVersion = null;
errorMessage = null;
}

@Override
@SuppressWarnings("rawtypes")
Expand Down Expand Up @@ -111,6 +118,7 @@ private String acceptOnlyIfUnsetOrEqualToAlreadySet(String existing, String newV

@Test
void multipleCRDVersions() {
informerStoppedHandler.reset();
operator.create(createTestResourceV1WithoutLabel());
operator.create(createTestResourceV2WithLabel());

Expand All @@ -132,6 +140,7 @@ void multipleCRDVersions() {

@Test
void invalidEventsShouldStopInformerAndCallInformerStoppedHandler() {
informerStoppedHandler.reset();
var v2res = createTestResourceV2WithLabel();
v2res.getMetadata().getLabels().clear();
operator.create(v2res);
Expand Down