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

Avoid duplicate classes in MergedContextConfiguration #24532

Conversation

@dreis2211
Copy link
Contributor

@dreis2211 dreis2211 commented Dec 16, 2020

Hi,

I just noticed the following log while debugging some test context cache optimizations in one of my projects:

19:44:41.758 [Test worker] DEBUG o.s.t.c.s... - Before test class: context [DefaultTestContext@209b736 ... classes = '{class com.example.Application, class com.example.Application}' ...], class annotated with @DirtiesContext [false] with mode [null].

It's trimmed down, but as you can see classes contains the same class twice. This seems to be happen when I explicitly declare the classes on @SpringBootTest as follows:

@SpringBootTest(classes = {Application.class})

While not critical at all, I guess we can make an effort to avoid the duplicates. That should fix the logs and maybe saves a few cycles on the road (although that impact should be veeery small as the duplicates are filtered in SpringApplication the latest).

Let me know what you think.
Cheers,
Christoph

philwebb added a commit that referenced this pull request Dec 16, 2020
Remove duplicate config attribute classes by using a `Set` rather
than a `List` in the `SpringBootTestContextBootstrapper`.

See gh-24532
@philwebb philwebb closed this in 2cd1459 Dec 16, 2020
@philwebb philwebb modified the milestones: 2.3.x, 2.3.8 Dec 16, 2020
@philwebb
Copy link
Member

@philwebb philwebb commented Dec 16, 2020

Thanks @dreis2211. I merged this into 2.3.x, 2.4.x and master.

@dreis2211
Copy link
Contributor Author

@dreis2211 dreis2211 commented Dec 16, 2020

@philwebb Thanks. On that note: is there a 2.5.x / master pipeline on Concourse yet?

@snicoll
Copy link
Member

@snicoll snicoll commented Dec 17, 2020

is there a 2.5.x / master pipeline on Concourse yet?

Yes

@dreis2211
Copy link
Contributor Author

@dreis2211 dreis2211 commented Dec 17, 2020

@snicoll Thanks, but the page is blank for me. Also, the build status badge inside the README can't be displayed at the moment. Seems like a permission problem.

@wilkinsona
Copy link
Member

@wilkinsona wilkinsona commented Dec 17, 2020

The pipeline should be visible now.

@dreis2211
Copy link
Contributor Author

@dreis2211 dreis2211 commented Dec 17, 2020

Indeed. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants