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

Make integration tests for content entity rest endpoints multithreaded again #2124

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rschev
Copy link
Contributor

@rschev rschev commented Sep 17, 2024

I added some tests that rely on threads=1, so I figured I'd fix that.

Comment on lines +130 to +132
AfterCreateEvent afterCreate = new AfterCreateEvent(savedEntity);
publisher.publishEvent(afterCreate);

Copy link
Contributor

Choose a reason for hiding this comment

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

This is not only changing the integration tests if you're moving the place where this event is emitted.

Copy link
Owner

Choose a reason for hiding this comment

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

This is true. I am not sure I have a strong opinion in this case. I cant thing of a reason why the publish cant be at the end of the call, rather than just after the event. I dont think it materially effects the behavior. WDYT?

Copy link
Contributor

@vierbergenlars vierbergenlars Oct 16, 2024

Choose a reason for hiding this comment

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

The difference is in the ordering of events.

Previously, the AfterCreateEvent is emitted before the set content events (which I believe are emitted internally inside the ContentStoreContentService methods).
Now, the AfterCreateEvent is emitted after the set content events.

It is a behavior that I think should explicitly be called out, not just sneaked in together with some changes in integration tests.

Copy link
Owner

Choose a reason for hiding this comment

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

Right. I would agree. But I doubt many folks are using this controller yet besides you folks. But that is valid. The only reason for this change is because of my general desire to support multi-threaded tests but we lapse in a bunch of places so if you are not comfortable with the event ordering changing then we probably should force it through in a test change.

@@ -40,7 +42,7 @@
import com.github.paulcwarren.ginkgo4j.Ginkgo4jSpringRunner;

@RunWith(Ginkgo4jSpringRunner.class)
@Ginkgo4jConfiguration(threads=1)
//@Ginkgo4jConfiguration(threads=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove commented code

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.

3 participants