Skip to content

Conversation

@tszmytka
Copy link
Contributor

This substitutes Thread.sleep() with calls to appropriate Awaitility methods as described in #21873

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 16, 2020
Copy link
Member

@wilkinsona wilkinsona left a comment

Choose a reason for hiding this comment

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

Thanks very much for the pull request. There are a couple of places where a call to server.stop() has been removed. I think they need to be kept. Could you please take a look and, if you agree, update your proposal to add them back in?

LiveReloadWebSocketHandler handler = connect();
this.server.triggerReload();
Thread.sleep(200);
this.server.stop();
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to keep this call to stop().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test class already has an @AfterEach which calls this.server.stop();.
I assumed the original author had written those 2 test cases first and only after that decided to have a general @AfterEach method (and maybe forgot to take the individual stop()s out).

I made sure that the tests run fine without them.
Do you think stop() should be kept nevertheless?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I'd missed that when reviewing the diffs in isolation. I agree there's no need to keep the stop() calls. To keep this change clean, I think it makes sense to remove the stop() calls separately. No need for you to do anything though. We can take care of it prior to merging this.

handler.sendMessage(new PingMessage());
Thread.sleep(200);
assertThat(handler.getPongCount()).isEqualTo(1);
this.server.stop();
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to keep this call to stop().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The same situation as above.

LiveReloadWebSocketHandler handler = connect();
this.server.triggerReload();
Thread.sleep(200);
this.server.stop();
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I'd missed that when reviewing the diffs in isolation. I agree there's no need to keep the stop() calls. To keep this change clean, I think it makes sense to remove the stop() calls separately. No need for you to do anything though. We can take care of it prior to merging this.

@wilkinsona wilkinsona self-assigned this Jun 18, 2020
@wilkinsona wilkinsona added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 18, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Jun 18, 2020
@wilkinsona wilkinsona mentioned this pull request Jun 19, 2020
wilkinsona pushed a commit that referenced this pull request Jun 19, 2020
wilkinsona added a commit that referenced this pull request Jun 19, 2020
@wilkinsona
Copy link
Member

Thanks very much, @tszmytka.

@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.9 Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task A general task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants