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

Test/SocketUtils replacement #327

Closed
onobc opened this issue Sep 22, 2022 · 5 comments · Fixed by #420
Closed

Test/SocketUtils replacement #327

onobc opened this issue Sep 22, 2022 · 5 comments · Fixed by #420
Assignees
Milestone

Comments

@onobc
Copy link
Collaborator

onobc commented Sep 22, 2022

Test/SocketUtils has been removed in SF6.

I have submitted a proposal that adds a lightweight version of it in spring-test (here). However, this will not be available until after SF goes GA.

In the meantime, I have copied it in all modules it was being used. We can leave as-is (which is pretty terrible) and then replace once the above PR is merged. OR is there something we can do now to reduce the duplication such as put the util in a common accessible package in this repo?

@onobc
Copy link
Collaborator Author

onobc commented Sep 27, 2022

As a primary goal, let's 1st attempt to remove usage completely (eg use server.port=0 or testcontainers etc..)

@gilbertotcc
Copy link

@onobc Hi, I'm trying to migrate to Spring Boot 3 and I have the same issue with some tests. Did you find a workaround to the lack of SocketUtils?

@onobc
Copy link
Collaborator Author

onobc commented Oct 22, 2022

Hi @gilbertotcc , what I have done is reduce usage of TestSocketUtils by reworking how we were doing some of the integration tests. In some cases, just setting the server.port to 0 and then polling ourselves for the actual port being used, or in some cases using testcontainers instead. However, in some cases we still needed the TestSocketUtils and I did that evil thing - you know, copy/pasta TestSocketUtils to the repo where it is needed. I will remove that once it is available in spring-test.

@gilbertotcc
Copy link

@onobc Thanks for the suggestions. I will try the same way (in the meanwhile).

@corneil
Copy link
Collaborator

corneil commented Nov 2, 2022

Most of the embedded services will allow providing port 0 and then after starting the port can be retrieved and assigned to client url.

@onobc onobc self-assigned this Jan 10, 2023
onobc added a commit to onobc/stream-applications that referenced this issue Jan 10, 2023
Fixes spring-cloud#327

- Delete local TSU temporary implementations
- Replace local TSU w/ spring-test TSU
onobc added a commit to onobc/stream-applications that referenced this issue Jan 11, 2023
Fixes spring-cloud#327

- Delete local TSU temporary implementations
- Replace local TSU w/ spring-test TSU
artembilan pushed a commit that referenced this issue Jan 11, 2023
Fixes #327

- Delete local TSU temporary implementations
- Replace local TSU w/ spring-test TSU
@onobc onobc modified the milestones: 2022.0.0, 4.0.0 May 30, 2023
artembilan pushed a commit to spring-cloud/spring-functions-catalog that referenced this issue Nov 22, 2023
Fixes spring-cloud/stream-applications#327

- Delete local TSU temporary implementations
- Replace local TSU w/ spring-test TSU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants