eclipse-platform/eclipse.platform

PlatformURLSessionTest fails since I20240513-1800

Closed this issue · 3 comments

I can not locally reproduce it - it only failed in i-build, but on all OS.
Probably regression from related commit a055e52 @HeikoKlare

org.opentest4j.AssertionFailedError: Expected java.io.IOException to be thrown, but nothing was thrown.
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:73)
at org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:35)
at org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3115)
at org.eclipse.core.tests.internal.runtime.PlatformURLSessionTest.test1OutputOnReadOnly(PlatformURLSessionTest.java:117)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.core.tests.harness.session.SessionTestExtension.interceptTestMethod(SessionTestExtension.java:235)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
org.opentest4j.AssertionFailedError: expected: <child> but was: <>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at org.eclipse.core.tests.internal.runtime.PlatformURLSessionTest.test2Resolution(PlatformURLSessionTest.java:132)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.core.tests.harness.session.SessionTestExtension.interceptTestMethod(SessionTestExtension.java:235)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)

https://download.eclipse.org/eclipse/downloads/drops4/I20240513-1800/testresults/html/org.eclipse.core.tests.runtime_ep432I-unit-macM1-java17_macosx.cocoa.aarch64_17.html

Yes, that's very likely releated to #1348. Obviously something specific to the I-Build, as in GH Actions and Jenkins runs for the PR (and master builds afterwards), they ran fine. I will have a look.

Failure is caused by the configuration area in the session test not being read-only during execution of the second and third test case of the class. The exact same failures can be reproduced locally by removing the setReadOnly() in the session customization intialization:

SessionTestExtension extension = SessionTestExtension.forPlugin(PI_RUNTIME_TESTS)
.withCustomization(SessionTestExtension.createCustomConfiguration().setCascaded().setReadOnly()).create();

Looks as if this is the same issue as this from 2007: https://bugs.eclipse.org/bugs/show_bug.cgi?id=210674
In consequence, a "temporary" hack was introduced, which is still part of the ConfigurationSessionTestSuite and which I expected to be obsolete today, so I did not implement it in the new JUnit 5 implementation of configured session tests:

// KLUDGE: this is a work around update.configurator's
// class PlatformConfiguration.initializeCurrent(). That method will overwrite
// config.ini for shared configurations. As there is no switch to alter
// that behavior and update.configurator is close to be being retired,
// the kludge here is to generate new config.ini for every test run.
if (cascaded)
{
try {
createConfigINI();
} catch (IOException e) {
fail(e);
}
// end of KLUDGE

I will integrate that functionality into the CustomSessionConfiguration to see if that resolves the problem.

Fix in #1367 proved successful, as tests succeed in today's I-Builds: https://download.eclipse.org/eclipse/downloads/drops4/I20240514-1800/testResults.php