Skip to content

Replace calls to verifyComplete() with expectComplete().verify(Duration) to avoid blocking indefinitely #35915

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

Closed

Conversation

ThomazPassarelli
Copy link
Contributor

This pull request addresses the issue #35791, where it was required to replace verifyComplete() with expectComplete().verify(Duration) in test cases across multiple files.

Changes made:

  1. Replaced verifyComplete() with expectComplete().verify(Duration.ofSeconds(5)) in all the necessary places. The decision to use Duration.ofSeconds(5) was influenced by its existing usage in another part of the project, ensuring consistency across the codebase.
  2. Added import java.time.Duration; where it was not already imported.

I have successfully made changes to 23 files and built the project without any errors. All the tests ran successfully after the changes.

@pivotal-cla
Copy link

@ThomazPassarelli Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 15, 2023
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 15, 2023
@philwebb philwebb added this to the 2.7.x milestone Jun 15, 2023
@philwebb philwebb changed the title Issue #35791: Replace verifyComplete() with expectComplete().verify(Duration) Replace calls to verifyComplete() with expectComplete().verify(Duration) to avoid blocking indefinitely Jun 15, 2023
@philwebb philwebb added the for: merge-with-amendments Needs some changes when we merge label Jun 15, 2023
@philwebb
Copy link
Member

When we merge this we should also consider this comment from the original issue:

We should also consider introducing an ArchUnit rule to prevent usage of verifyComplete() from being reintroduced.

@wilkinsona
Copy link
Member

I've got one locally.

We should also remove any calls to StepVerifier.setDefaultTimeout as they're unnecessary when using expectedComplete().verify(Duration) everywhere.

@wilkinsona wilkinsona self-assigned this Jun 15, 2023
@wilkinsona
Copy link
Member

@ThomazPassarelli can you please sign the CLA when you have a moment?

@pivotal-cla
Copy link

@ThomazPassarelli Thank you for signing the Contributor License Agreement!

@wilkinsona
Copy link
Member

Thanks very much, @ThomazPassarelli.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: merge-with-amendments Needs some changes when we merge type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants