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 RequestService test sometimes failing in CICD #2561

Merged

Conversation

alexandrevryghem
Copy link
Member

Description

Because tests are executed slower on CICD it can sometimes take one second or more to execute the RequestService#setStaleByHref(href), when the test arrives inside the subscribe, a create new RequestStaleAction with the current time is created (this can already be a few seconds after RequestService#setStaleByHref(href) was called). To prevent such errors we can just expect that lastUpdated will be a number instead of comparing the actual values. The purpose of that test is to check the type of RequestUpdateAction returned by the function and not the date when it was created, so this doesn't have any side effects. This is an example of such a failure.

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@alexandrevryghem alexandrevryghem self-assigned this Oct 21, 2023
@alexandrevryghem alexandrevryghem added quick win Pull request is small in size & should be easy to review and/or merge code task testing framework Related specifically to Unit or Integration (e2e) Tests labels Oct 21, 2023
@tdonohue tdonohue added 1 APPROVAL pull request only requires a single approval to merge port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release labels Oct 23, 2023
@tdonohue tdonohue added this to the 7.6.1 milestone Oct 23, 2023
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

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

👍 Thanks @alexandrevryghem for tracking this down, as I've seen this random failure as well.

This seems like a reasonable fix, so I'll merge it immediately as it only impacts the specs.

@tdonohue tdonohue modified the milestones: 7.6.1, 8.0 Oct 23, 2023
@tdonohue tdonohue merged commit a9d7ee3 into DSpace:main Oct 23, 2023
11 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Oct 23, 2023
@alexandrevryghem alexandrevryghem deleted the fix-failing-request-service-test branch August 2, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge code task quick win Pull request is small in size & should be easy to review and/or merge testing framework Related specifically to Unit or Integration (e2e) Tests
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants