Skip to content

More tuncate() in tests #10378

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

Merged
merged 2 commits into from
Jun 20, 2025
Merged

More tuncate() in tests #10378

merged 2 commits into from
Jun 20, 2025

Conversation

gavinking
Copy link
Member

[Please describe here what your change is about]


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.


@hibernate-github-bot
Copy link

hibernate-github-bot bot commented Jun 20, 2025

Thanks for your pull request!

This pull request does not follow the contribution rules. Could you have a look?

❌ All commit messages should start with a JIRA issue key matching pattern HHH-\d+
    ↳ Offending commits: [530aa33, 5d8dcf5]

› This message was automatically generated.

@@ -122,7 +121,7 @@ void verifyCheckConstraints2(SessionFactoryScope scope) {

@AfterEach
void dropTestData(SessionFactoryScope scope) {
scope.inTransaction( (session) -> session.createMutationQuery( "delete Person" ).executeUpdate() );
scope.getSessionFactory().getSchemaManager().truncate();
Copy link
Member

Choose a reason for hiding this comment

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

I wonder ... what if we add something like

public @interface SessionFactory {
	boolean truncate() default true; 
....

And do it as part of the extension rather than in the tests? (then we could skip a lot of these after each calls ...)

Copy link
Member Author

Choose a reason for hiding this comment

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

@marko-bekhta Yeah, that would be great.

Copy link
Member

Choose a reason for hiding this comment

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

So I gave it a try (truncate after each, evict cache after each):

15901 tests

756 failures

🙈 🥲

Copy link
Member Author

Choose a reason for hiding this comment

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

weird.

Copy link
Member

@marko-bekhta marko-bekhta Jun 20, 2025

Choose a reason for hiding this comment

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

here's that experiment: #10380

from a few tests I've checked they either want to do something witch cache or rely on BeforeAll to setup the test data ...

(I set the defaults to NEVER in that PR so it should pass the tests ... but if we want to make the cleanups more automatic, we'd probably have to adjust those failing tests 😃 )

@gavinking gavinking merged commit 44c62a5 into hibernate:main Jun 20, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants