Running LocaotrUDPSecurityDUnitTest by itself using
-DdistributedTest.single= results in skipping the test as expected.

/gradlew -DdistributedTest.single=LocatorUDPSecurityDUnitTest
geode-core:distributedTest

2017-02-16 14:27:46.076 -0800 Starting test
org.apache.geode.distributed.LocatorUDPSecurityDUnitTest
testSSLEnabledLocatorDiesWhenConnectingToNonSSLLocator
2017-02-16 14:27:46.076 -0800 Completed test
org.apache.geode.distributed.LocatorUDPSecurityDUnitTest
testSSLEnabledLocatorDiesWhenConnectingToNonSSLLocator with result: SKIPPED

So I have no idea what causes Jenkins in the nightly build to not ignore
the test. Very weird.

On Thu, Feb 16, 2017 at 2:27 PM, Kirk Lund <[email protected]> wrote:

> It's possible this might be caused by a bug in Gradle's JUnit task which
> is how Jenkins is running this test. The test method is skipped as expected
> when run in IntelliJ.
>
> On Thu, Feb 16, 2017 at 2:17 PM, Kirk Lund <[email protected]> wrote:
>
>> LocatorUDPSecurityDUnitTest extends LocatorDUnitTest.
>>
>> LocatorDUnitTest has a test named 
>> testSSLEnabledLocatorDiesWhenConnectingToNonSSLLocator
>> which is currently annotated with @Ignore.
>>
>> Despite the test being marked with @Ignore, apparently the test still
>> gets executed by LocatorUDPSecurityDUnitTest. See last night's Geode
>> Nightly Build in which this test failed:
>>
>> https://builds.apache.org/job/Geode-nightly/750/testReport/j
>> unit/org.apache.geode.distributed/LocatorUDPSecurityDUnitTes
>> t/testNonSSLLocatorDiesWhenConnectingToSSLLocator/
>>
>> I recommend we avoid extending other tests. If you have some
>> setup/teardown that you really want to reuse in multiple tests then create
>> a custom JUnit rule. Or very carefully put the body of the test in a
>> non-test class that is not annotated with JUnit annotations and then have
>> two different tests both invoke code in the non-test class -- I would
>> recommend avoiding this approach in general to avoid creating spaghetti or
>> having multiple tests repeating the same end-to-end code with slight
>> variations to config which redundantly extends the run time of precheckin.
>>
>> I think the only way to get LocatorUDPSecurityDUnitTest to not run the
>> @Ignored test is to @Override the test method AND add its own @Ignore
>> annotation.
>>
>> This could be a bug in JUnit, but we're already using JUnit 4.12 which is
>> the latest release.
>>
>> -Kirk
>>
>>
>

Reply via email to