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

add wait to async export call #11033

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

stevenwinship
Copy link
Contributor

@stevenwinship stevenwinship commented Nov 18, 2024

What this PR does / why we need it: Sporadic test failures in DatasetsIT due to not waiting for an asynchronous call to finish

Which issue(s) this PR closes:#11032

Special notes for your reviewer:

Suggestions on how to test this: See IT tests. Monitor Jenkins for failures after merging

Does this PR introduce a user interface change? If mockups are available, please link/include them here:No

Is there a release notes update needed for this change?:No

Additional documentation:No

@stevenwinship stevenwinship self-assigned this Nov 18, 2024
@stevenwinship stevenwinship added Type: Bug a defect Size: 3 A percentage of a sprint. 2.1 hours. FY25 Sprint 10 FY25 Sprint 10 (2024-11-06 - 2024-11-20) labels Nov 18, 2024
Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

This looks fine except it only needs one call to get the export.

// http://localhost:8080/api/datasets/export?exporter=dataverse_json&persistentId=doi%3A10.5072/FK2/W6WIMQ
RequestSpecification requestSpecification = given();
if (apiToken != null) {
requestSpecification = given()
.header(UtilIT.API_TOKEN_HTTP_HEADER, apiToken);
}
return requestSpecification
Response resp = requestSpecification
Copy link
Member

Choose a reason for hiding this comment

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

This only needs to be called once, after waiting if wait=true.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

// http://localhost:8080/api/datasets/export?exporter=dataverse_json&persistentId=doi%3A10.5072/FK2/W6WIMQ
RequestSpecification requestSpecification = given();
if (apiToken != null) {
requestSpecification = given()
.header(UtilIT.API_TOKEN_HTTP_HEADER, apiToken);
}
return requestSpecification
Response resp = requestSpecification
// .header(API_TOKEN_HTTP_HEADER, apiToken)
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to keep these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed commented out code

This comment has been minimized.

Copy link

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:11032-async-datasetit-test-failure
ghcr.io/gdcc/configbaker:11032-async-datasetit-test-failure

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

Copy link
Member

@qqmyers qqmyers left a comment

Choose a reason for hiding this comment

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

LGTM

@stevenwinship stevenwinship removed their assignment Nov 18, 2024
@ofahimIQSS
Copy link
Contributor

Merging PR monitoring Jenkins

@ofahimIQSS ofahimIQSS merged commit 6d0afad into develop Nov 19, 2024
19 checks passed
@ofahimIQSS ofahimIQSS deleted the 11032-async-datasetit-test-failure branch November 19, 2024 16:51
@pdurbin pdurbin added this to the 6.5 milestone Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY25 Sprint 10 FY25 Sprint 10 (2024-11-06 - 2024-11-20) Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug a defect
Projects
Status: Merged 🚀
Development

Successfully merging this pull request may close these issues.

Async call in DatasetsIT test causes sporadic test failures
4 participants