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

regression: forked container unit tests failing #1056

Open
reschke opened this issue Mar 28, 2022 · 13 comments
Open

regression: forked container unit tests failing #1056

reschke opened this issue Mar 28, 2022 · 13 comments
Assignees
Labels
Milestone

Comments

@reschke
Copy link

reschke commented Mar 28, 2022

18 [main] INFO org.ops4j.pax.exam.junit.DriverExtension - creating PaxExam runner for class org.ops4j.pax.exam.forked.ReferenceJarTest
73 [main] INFO org.ops4j.pax.exam.spi.DefaultExamSystem - Pax Exam System (Version: 5.0.0-SNAPSHOT) created.
Running org.ops4j.pax.exam.forked.ForkedFrameworkFactoryTest
1020 [main] INFO org.ops4j.pax.exam.ExamJavaRunner - ExamJavaRunner completed successfully

1021 [main] INFO org.ops4j.pax.exam.forked.ForkedFrameworkFactory - Connecting to host: 127.0.0.1 port: 21000
3473 [main] INFO org.ops4j.pax.exam.ExamJavaRunner - ExamJavaRunner completed successfully

3473 [main] INFO org.ops4j.pax.exam.forked.ForkedFrameworkFactory - Connecting to host: 127.0.0.1 port: 21001

8649 [main] INFO org.ops4j.pax.exam.ExamJavaRunner - Platform has been shutdown.
Tests run: 4, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.713 sec <<< FAILURE! - in org.ops4j.pax.exam.forked.ForkedFrameworkFactoryTest
forkEquinox(org.ops4j.pax.exam.forked.ForkedFrameworkFactoryTest)  Time elapsed: 2.497 sec  <<< ERROR!
java.rmi.ServerError: Error occurred in server thread; nested exception is:
        java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

Downgrading the swissbox dependency to 1.8.3 fixes the issue (that is, reverting #1021)

@reschke
Copy link
Author

reschke commented Mar 28, 2022

cc @jbonofre

@oliverlietz
Copy link
Member

@reschke Does downgrading Swissbox in 4.13.6-SNAPSHOT also fix the issue?

@reschke
Copy link
Author

reschke commented Jun 19, 2022

I don't quiet understand the question - the bug report is for what's current in "master"; and that hasn't changed since Nov 2021.

@oliverlietz
Copy link
Member

There is a regression in versions newer 4.13.3 which could be the same or similar and prevents me from upgrading Pax Exam in several Sling projects. Never mind, I will investigate when back at desk.

@reschke
Copy link
Author

reschke commented Jun 19, 2022

Yes, I believe we talk about the same regression (or multiple ones).

@reschke
Copy link
Author

reschke commented Jun 20, 2023

Just checking: is anybody actually working actively on pax-exam?

@laeubi
Copy link
Member

laeubi commented Jun 20, 2023

Not that I'm aware of depending on your needs osgi-test might be a more lightweight alternative:

but it is all open source so if you want open a PR with a fix and I think it could be merged without much issues,

@splatch
Copy link
Member

splatch commented Jun 20, 2023

@reschke I intended to do some work around junit 5 support and relatives, however ended up not doing so yet.
Mean while other project where I worked with where I expected to see more pax-exam decided to go with test containers as a more consistent way for testing multiple things. We do have some Karaf integration tests, which normally would work with pax: https://github.com/OpenNMS-Cloud/lokahi/blob/v0.0.42-dev/minion/docker-it/src/test/java/org/opennms/horizon/dockerit/testcontainers/TestContainerRunnerClassRule.java

Main difference there is - you can verify system behavior. If you are still interested in asserting internal state of framework or supplied extensions - exam or tools pointed by @laeubi is way to go, as it will give you access to all low level details. For any system level testing test-containers will do the job. I hope to put some more effort into ConnectorIO/connectorio-addons#5 in July and make it a drop-in replacement of higher level tests.

@splatch
Copy link
Member

splatch commented Jun 23, 2023

FYI, I've extracted some of the code from that repository into separate repository. I made also an attempt to separate container handling from customization (what we know as exam options) so they can be applied across different distributions.
I'll continue working on it further: https://github.com/ConnectorIO/connectorio-testcontainers and try to see how it will work with integration tests for openHAB (readme is missing for now ;-)).

oliverlietz added a commit that referenced this issue Aug 13, 2023
downgrade Swissbox to 1.8.3 until issue with/in Swissbox is fixed
@oliverlietz
Copy link
Member

@reschke, Were you able to identify the change in Swissbox which is causing the issue?

@oliverlietz oliverlietz self-assigned this Aug 13, 2023
@oliverlietz oliverlietz added this to the 4.14.0 milestone Aug 13, 2023
@oliverlietz oliverlietz moved this to In Progress in Pax Exam 4.x Aug 18, 2023
@reschke
Copy link
Author

reschke commented Sep 29, 2023

@reschke, Were you able to identify the change in Swissbox which is causing the issue?

Nope.

@oliverlietz oliverlietz modified the milestones: 4.14.0, 4.x Oct 25, 2024
@oliverlietz
Copy link
Member

The issue was caused by the introduction of Logger and LoggerFactory into ServiceLookup in commit ed0dccb.

@oliverlietz
Copy link
Member

Fixed by #1124.

@oliverlietz oliverlietz moved this from In Progress to Done in Pax Exam 4.x Nov 4, 2024
@oliverlietz oliverlietz modified the milestones: 4.x, 4.14.0 Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

4 participants