Fix and reenable ExpressionTests.testSubTypeTiming#2601
Fix and reenable ExpressionTests.testSubTypeTiming#2601HeikoKlare wants to merge 2 commits intoeclipse-platform:masterfrom
Conversation
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Test Results 36 files - 18 36 suites - 18 20m 36s ⏱️ - 15m 24s Results for commit 880db67. ± Comparison against base commit 0eda9f4. This pull request skips 25 and un-skips 1 tests.♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Re-enables the previously disabled ExpressionTests.testSubTypeTiming by replacing a flaky, timing-based assertion with a deterministic verification of Expressions subtype-cache behavior.
Changes:
- Reworks
testSubTypeTimingto useMockito.mockStaticand verify cached subtype checks avoid repeateduncachedIsSubtypecalls. - Introduces a test-only
CachingTestSettype to isolate the cache key used by the test. - Updates the test bundle manifest to import
org.mockito(and bumps the bundle version).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| runtime/tests/org.eclipse.core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTests.java | Replaces timing assertions with a static-mock-based cache verification and re-enables the test. |
| runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF | Adds Mockito package import and increments bundle version to reflect dependency/test changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
....core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTests.java
Outdated
Show resolved
Hide resolved
....core.expressions.tests/src/org/eclipse/core/internal/expressions/tests/ExpressionTests.java
Outdated
Show resolved
Hide resolved
79d0ee8 to
c5c6b07
Compare
Replaces the flaky timing-based assertion with a functional validation of the caching behaviour: uses Mockito.mockStatic to verify that Expressions.uncachedIsSubtype is invoked exactly once for a given (Class, type) pair across two consecutive isInstanceOf calls, proving that the second call is served from the cache. Fixes eclipse-platform#894
c5c6b07 to
880db67
Compare
Summary
testSubTypeTimingwith a functional validation of the caching behaviourMockito.mockStaticto verify thatExpressions.uncachedIsSubtypeis invoked exactly once for a given(Class, type)pair across two consecutiveisInstanceOfcalls, proving the second call is served from the cacheorg.mockitotoImport-Packagein the test bundle'sMANIFEST.MFFixes #894