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

Some tests are incompatible with Rabbit 3.6 Java client #154

Closed
wilkinsona opened this issue Jan 15, 2016 · 3 comments
Closed

Some tests are incompatible with Rabbit 3.6 Java client #154

wilkinsona opened this issue Jan 15, 2016 · 3 comments
Assignees
Milestone

Comments

@wilkinsona
Copy link
Contributor

Spring IO Platform 2.1 contains Spring AMQP 1.6 which requires version 3.6 of Rabbit's Java client. When Spring Cloud Connector's tests are run against the 3.6 client, two tests fail:

java.lang.AssertionError: expected:<0> but was:<60>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at org.springframework.cloud.config.RabbitConnectionFactoryCloudConfigTestHelper.assertConfigProperties(RabbitConnectionFactoryCloudConfigTestHelper.java:26)
    at org.springframework.cloud.config.java.RabbitConnectionFactoryJavaConfigTest.cloudRabbitConnectionFactoryWithConfig(RabbitConnectionFactoryJavaConfigTest.java:41)
java.lang.AssertionError: expected:<0> but was:<60>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at org.springframework.cloud.config.RabbitConnectionFactoryCloudConfigTestHelper.assertConfigProperties(RabbitConnectionFactoryCloudConfigTestHelper.java:26)
    at org.springframework.cloud.config.xml.RabbitConnectionFactoryXmlConfigTest.cloudRabbitConnectionFactoryWithConfiguration(RabbitConnectionFactoryXmlConfigTest.java:39)

You can reproduce the two failures by running the following build:

./gradlew clean springIoCheck -PJDK8_HOME=<path-to-jdk8-home> -PplatformVersion=2.1.0.BUILD-SNAPSHOT --continue

Unfortunately, this can't be fixed by just changing the Rabbit client dependency and updating the tests accordingly in 1.2.x. As things stand Spring Cloud Connectors 1.2.x is part of Spring IO Platform 2.0 (which uses Rabbit Client 3.4.x) and not-yet-released Spring IO Platform 2.1 which uses 3.6.x. This means that 1.2.x's tests need to pass when run against both versions of the client.

A few ideas:

  1. Create a new minor release of Spring Cloud Connectors that uses Rabbit Client 3.6.x. This seems excessive if there are no other changes to warrant the new minor release.
  2. Update the tests so that they no longer assert the client's defaults and just assert on the pieces of configuration that Spring Cloud Connectors has set.
  3. Update the tests so that they accept either the old default or the new default
garyrussell added a commit to garyrussell/spring-cloud-connectors that referenced this issue Jan 15, 2016
@garyrussell
Copy link
Contributor

Spring AMQP 1.6 which requires version 3.6

Just one point of clarification; 1.6 does not require 3.6, it just pulls it in by default; it's actually backwards-compatible to 3.4.

Not pertinent to this discussion of course but I also noticed that the connector is still using an ancient client (2.8.1) by default.

#155

@garyrussell garyrussell self-assigned this Jan 15, 2016
@wilkinsona
Copy link
Contributor Author

Thanks, Gary. I was a little sloppy. A more accurate statement would have been that Spring AMQP 1.6's tests require 3.6.

scottfrederick added a commit that referenced this issue Feb 12, 2016
GH-154 Fix Rabbit Tests with 3.6 Client
@scottfrederick scottfrederick added this to the 1.2.2 milestone Feb 12, 2016
@scottfrederick
Copy link
Contributor

Thanks @wilkinsona and @garyrussell. Gary's PR looks good, and has been merged.

Not pertinent to this discussion of course but I also noticed that the connector is still using an ancient client (2.8.1) by default.

Connectors generally relies on the oldest versions of Spring and connection dependencies that are API-compatible with the things it needs to do. This helps ensure that Connectors is compatible with as many client apps as possible. Connectors has only optional dependencies on other Spring and connection libraries (as it expects the client app to bring its own versions of just the dependencies it needs) so none of these dependencies is transitive.

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

No branches or pull requests

3 participants