blueflood: Maven build tests fail on Ubuntu 16.04 with OpenJDK 1.8
Good morning,
The tests on blueflood masterbranch are not passing on my machine when running mvn test -X integration-test.
testConfigTtl_valid(com.rackspacecloud.blueflood.cache.ConfigTtlProviderTest) Time elapsed: 0.009 sec <<< ERROR!
java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
at com.rackspacecloud.blueflood.cache.ConfigTtlProviderTest.testConfigTtl_valid(ConfigTtlProviderTest.java:50)
testConfigTtlForStrings(com.rackspacecloud.blueflood.cache.ConfigTtlProviderTest) Time elapsed: 0 sec <<< FAILURE!
java.lang.AssertionError
at com.rackspacecloud.blueflood.cache.ConfigTtlProviderTest.testConfigTtlForStrings(ConfigTtlProviderTest.java:61)
Running com.rackspacecloud.blueflood.cache.SafetyTtlProviderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.003 sec - in com.rackspacecloud.blueflood.cache.SafetyTtlProviderTest
Running com.rackspacecloud.blueflood.cache.CombinedTtlProviderTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in com.rackspacecloud.blueflood.cache.CombinedTtlProviderTest
Running com.rackspacecloud.blueflood.cache.LocatorCacheTest
Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 18.011 sec - in com.rackspacecloud.blueflood.cache.LocatorCacheTest
Results :
Failed tests:
ConfigTtlProviderTest.testConfigTtlForStrings:61
Tests in error:
ConfigTtlProviderTest.testConfigTtl_valid:50 » IllegalState Optional.get() can...
Tests run: 734, Failures: 1, Errors: 1, Skipped: 0
Disabling (commenting out actually) of the com.rackspacecloud.blueflood.cache.ConfigTtlProviderTest.testConfigTtl_valid and com.rackspacecloud.blueflood.cache.ConfigTtlProviderTest.testConfigTtlForStrings works (of course) and maven finishes the blueflood-core tests without problems.
This smells like a Java 8 upgrading issue, because it is about Optionals, i think.
Specs:
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_121, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-75-generic", arch: "amd64", family: "unix"
openjdk version "1.8.0_121"
OpenJDK Runtime Environment (build 1.8.0_121-8u121-b13-0ubuntu1.16.04.2-b13)
OpenJDK 64-Bit Server VM (build 25.121-b13, mixed mode)
I’m looking into it myself right now, but are not yet familiar with the code myself, nor with Optionals. I’ll post a fix if I find one, but if somebody knows a fix already, please comment.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- fix for issue #806 : failing tests when run on Ubuntu 16.04, cleanup string ttls — committed to shintasmith/blueflood by shintasmith 7 years ago
- Merge pull request #807 from shintasmith/fix_ttl_test_ubuntu16 Fix failing TTL tests run on Ubuntu 16.04 (Issue #806) — committed to rax-maas/blueflood by shintasmith 7 years ago
@basdusee , I just got a chance to spin off an Unbuntu 16.04 and I am able to reproduce the issue there. I know what the problem is.
The issue is that the tests run on Ubuntu 16.04 in different order than on my Mac and probably on your CentOS. I don’t know why they are in different order. But this causes
ConfigTtlProvider
to be initialized prematurely. I’m working on a fix. Thanks!