Skip to content
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

Fix (CLI): Fixed flaky test ContentTypeCommandIT.Test_Command_Content_Type_Folder_Push #30304

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 @@ -63,9 +63,6 @@ public String createContentTypeOnServer(final String detailPage, final String ur

final ContentTypeAPI contentTypeAPI = clientFactory.getClient(ContentTypeAPI.class);

final long identifier = System.currentTimeMillis();
final String varName = "var_" + identifier;

final ImmutableSimpleContentType contentType = buildContentType(
null, null, detailPage, urlMapPattern
);
Expand All @@ -74,7 +71,12 @@ public String createContentTypeOnServer(final String detailPage, final String ur
from(contentType).build();
contentTypeAPI.createContentTypes(List.of(saveRequest));

return varName;
// Make sure the content type is created, and we are giving the server some time to process
findContentType(contentType.variable()).orElseThrow(() -> new RuntimeException(
"Content type not found after creation: " + contentType.variable()
));

return contentType.variable();
}

/**
Expand Down