eclipse-jdt / eclipse-jdt/eclipse.jdt.core

ClasspathTests / JavaModelTests seem to be unstable

Open
#2,716 27 comments 0 reactions 0 assignees View on GitHub
bug build test failure test
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 10h
Merged PRs (30d)
49

Description

See https://github.com/eclipse-jdt/eclipse.jdt.core/pull/2551/checks?check_run_id=27502347557

Two tests failed (fully unrelated to the changes on the branch https://github.com/eclipse-jdt/eclipse.jdt.core/pull/2551), common is that something basic what the test setup did in the project/file system wasn't "seen" by the test assertions moments later.

I have not yet an explanation for that, except there are some jobs running in the background and we run into some asynchronous update issues...

**JavaModelTests.testGetJavaProjects1**
```
junit.framework.AssertionFailedError: Project P should be present
at junit.framework.Assert.fail(Assert.java:57)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.TestCase.assertTrue(TestCase.java:192)
at org.eclipse.jdt.core.tests.model.JavaModelTests.testGetJavaProjects1(JavaModelTests.java:402)
```

**ClasspathTests.testUnknownElements1**
```
junit.framework.ComparisonFailure:
Unexpected content.
----------- Expected ------------
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n

------------ but was ------------
\n
\n
\n
\n
\n
\n

---------------------- ----------
expected:<...lasspathentry kind="[src" path="src2"/>\n
\n
\n
\n
\n
\n
\n
\n...> but was:<...lasspathentry kind="[var" path="JCL18_LIB"/>\n
\n
\n
\n...>
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertStringEquals(TestCase.java:267)
at org.eclipse.jdt.core.tests.junit.extension.TestCase.assertEquals(TestCase.java:242)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSourceEquals(AbstractJavaModelTests.java:1192)
at org.eclipse.jdt.core.tests.model.AbstractJavaModelTests.assertSourceEquals(AbstractJavaModelTests.java:1172)
at org.eclipse.jdt.core.tests.model.ClasspathTests.testUnknownElements1(ClasspathTests.java:5787)
```

Contributor guide

Open the contributing guide

Research direction

Start with JavaModelTests.testGetJavaProjects1 at JavaModelTests.java:402 and ClasspathTests.testUnknownElements1 at ClasspathTests.java:5787, then reproduce the reported failures. Trace whether project and file-system updates are visible before assertions; done means both tests reliably observe the expected projects and classpath content.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.