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

KapuaLifeCycleConverterTest JUnit test failing in latest PRs #3270

Closed
gbarbon opened this issue Mar 9, 2021 · 3 comments · Fixed by #3272
Closed

KapuaLifeCycleConverterTest JUnit test failing in latest PRs #3270

gbarbon opened this issue Mar 9, 2021 · 3 comments · Fixed by #3272
Assignees
Labels
Bug This is a bug or an unexpected behaviour. Fix it! Test Test related stuff. It's a dirty job, but someone needs to do that!

Comments

@gbarbon
Copy link
Member

gbarbon commented Mar 9, 2021

Describe the bug
The KapuaLifeCycleConverterTest JUnit test are failing in all the latest PRs (see the list below), preventing us to merge new code. This seems to be not related with the specific changes introduced with the various PRs, since the changes involves different modules, while the failures are always the same.

The failures are occurring both locally and on the GitHub Actions environment. However, when I tried running only the KapuaLifeCycleConverterTest on my IDE, the tests are passing. These makes me think that there is some variable which remains 'dirty' from previous tests. In particular, all the assert failures (see the list below) seems to be related to the content of the converterNotifyMessage object, which is a metric provided by the MetricServiceFactory.

To Reproduce
Launch the following command in the terminal: mvn -B -Dcommons.db.schema=kapuadb -Dcommons.settings.hotswap=true -Dbroker.host=localhost -Dgroups='org.eclipse.kapua.qa.markers.junit.JUnitTests' verify

Expected behavior
Junit tests should not fail.

Screenshots
n/a

Version of Kapua
[e.g. 1.0.0]

Type of deployment
[ ] Local Vagrant deployment
[ ] Docker
[ ] Openshift (in its variants)
[x] Others

Main component affected
[ ] Console (in case of console please report info on which browser you encountered the problem)
[ ] REST API
[ ] Message Broker
[x] - Others

Additional context

These are the PRs currently impacted by this issue: #3260 , #3264 , #3265 , #3267

These are the failures:

[ERROR] Tests run: 20, Failures: 20, Errors: 0, Skipped: 0, Time elapsed: 0.091 s <<< FAILURE! - in org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest
[ERROR] convertToNotifyNullValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.017 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToNotifyNullValueTest(KapuaLifeCycleConverterTest.java:623)

[ERROR] convertToAppsNullExchangeTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToAppsNullExchangeTest(KapuaLifeCycleConverterTest.java:159)

[ERROR] convertToNotifyNullExchangeTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.003 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToNotifyNullExchangeTest(KapuaLifeCycleConverterTest.java:599)

[ERROR] convertToMissingNullExchangeTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToMissingNullExchangeTest(KapuaLifeCycleConverterTest.java:489)

[ERROR] convertToNotifyTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.022 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToNotifyTest(KapuaLifeCycleConverterTest.java:552)

[ERROR] convertToBirthObjectValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.005 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToBirthObjectValueTest(KapuaLifeCycleConverterTest.java:245)

[ERROR] convertToNotifyObjectValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.004 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToNotifyObjectValueTest(KapuaLifeCycleConverterTest.java:575)

[ERROR] convertToDisconnectNullExchangeTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.003 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToDisconnectNullExchangeTest(KapuaLifeCycleConverterTest.java:379)

[ERROR] convertToDisconnectNullValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.004 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToDisconnectNullValueTest(KapuaLifeCycleConverterTest.java:403)

[ERROR] convertToMissingObjectValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToMissingObjectValueTest(KapuaLifeCycleConverterTest.java:465)

[ERROR] convertToBirthNullValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.003 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToBirthNullValueTest(KapuaLifeCycleConverterTest.java:293)

[ERROR] convertToMissingTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.004 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToMissingTest(KapuaLifeCycleConverterTest.java:442)

[ERROR] convertToAppsObjectValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToAppsObjectValueTest(KapuaLifeCycleConverterTest.java:135)

[ERROR] convertToDisconnectTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.003 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToDisconnectTest(KapuaLifeCycleConverterTest.java:332)

[ERROR] convertToBirthTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.003 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToBirthTest(KapuaLifeCycleConverterTest.java:222)

[ERROR] convertToAppsNullValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToAppsNullValueTest(KapuaLifeCycleConverterTest.java:183)

[ERROR] convertToBirthNullExchangeTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToBirthNullExchangeTest(KapuaLifeCycleConverterTest.java:269)

[ERROR] convertToMissingNullValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToMissingNullValueTest(KapuaLifeCycleConverterTest.java:513)

[ERROR] convertToDisconnectObjectValueTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.001 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToDisconnectObjectValueTest(KapuaLifeCycleConverterTest.java:355)

[ERROR] convertToAppsTest(org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest)  Time elapsed: 0.002 s  <<< FAILURE!
java.lang.AssertionError: Expected and actual values should be the same. expected:<0> but was:<1>
	at org.eclipse.kapua.broker.core.converter.KapuaLifeCycleConverterTest.convertToAppsTest(KapuaLifeCycleConverterTest.java:112)
@gbarbon gbarbon added Bug This is a bug or an unexpected behaviour. Fix it! Test Test related stuff. It's a dirty job, but someone needs to do that! labels Mar 9, 2021
@gbarbon
Copy link
Member Author

gbarbon commented Mar 9, 2021

Hi @LeoNerdoG , I'm adding you to the discussion. I saw another issue related to the JUnit tests ( #3269 ), but I don't know if this is related.

@LeoNerdoG
Copy link
Contributor

Hey @gbarbon,
I have spotted this more than a month ago when running unit tests locally.
Then Sonja spotted this in her failing PRs - we have already fixed this (we just copied my solution/code to her PRs).
The best thing is to either merge Sonja's PRs or mine - #3255; after that the problem will be solved.

Issue #3269 is not related to this.

@gbarbon
Copy link
Member Author

gbarbon commented Mar 11, 2021

HI @LeoNerdoG , thanks. I created a dedicated PR focusing only on those issues, since the one you mention is still under review and quite big.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug or an unexpected behaviour. Fix it! Test Test related stuff. It's a dirty job, but someone needs to do that!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants