Skip to content

Fix and reenable ExpressionTests.testSubTypeTiming#2601

Open
HeikoKlare wants to merge 2 commits intoeclipse-platform:masterfrom
HeikoKlare:fix/reenable-testSubTypeTiming
Open

Fix and reenable ExpressionTests.testSubTypeTiming#2601
HeikoKlare wants to merge 2 commits intoeclipse-platform:masterfrom
HeikoKlare:fix/reenable-testSubTypeTiming

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

Summary

  • Replaces the flaky timing-based assertion in testSubTypeTiming 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 the second call is served from the cache
  • Adds org.mockito to Import-Package in the test bundle's MANIFEST.MF

Fixes #894

@eclipse-platform-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF

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 patch
From c310c2110f315787bace887341cf0e09f206b89e Mon Sep 17 00:00:00 2001
From: Eclipse Platform Bot <platform-bot@eclipse.org>
Date: Wed, 1 Apr 2026 20:45:34 +0000
Subject: [PATCH] Version bump(s) for 4.40 stream


diff --git a/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF b/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF
index 3ff1868923..af9222664e 100644
--- a/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF
+++ b/runtime/tests/org.eclipse.core.expressions.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.core.expressions.tests; singleton:=true
-Bundle-Version: 3.7.700.qualifier
+Bundle-Version: 3.7.800.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Export-Package: 
-- 
2.53.0

Further information are available in Common Build Issues - Missing version increments.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Test Results

   36 files   -    18     36 suites   - 18   20m 36s ⏱️ - 15m 24s
4 558 tests ±    0  4 511 ✅  -    23   47 💤 +24  0 ❌  - 1 
8 180 runs   - 4 090  8 073 ✅  - 4 037  107 💤  - 52  0 ❌  - 1 

Results for commit 880db67. ± Comparison against base commit 0eda9f4.

This pull request skips 25 and un-skips 1 tests.
org.eclipse.core.tests.filesystem.SymlinkTest ‑ testSymlinkPutHidden
org.eclipse.core.tests.internal.alias.BasicAliasTest ‑ testBug198571
org.eclipse.core.tests.internal.localstore.MoveTest ‑ testMoveFileAcrossVolumes
org.eclipse.core.tests.internal.localstore.MoveTest ‑ testMoveFolderAcrossVolumes
org.eclipse.core.tests.resources.IProjectTest ‑ testProjectCreationLocationExistsWithDifferentCase
org.eclipse.core.tests.resources.IWorkspaceRootTest ‑ testFindFilesNonCanonicalPath
org.eclipse.core.tests.resources.LinkedResourceTest ‑ testFindFilesForLocationCaseVariant
org.eclipse.core.tests.resources.LinkedResourceWithPathVariableTest ‑ testFindFilesForLocationCaseVariant
org.eclipse.core.tests.resources.ResourceAttributeTest ‑ testAttributeArchive
org.eclipse.core.tests.resources.ResourceAttributeTest ‑ testAttributeHidden
…
org.eclipse.core.internal.expressions.tests.ExpressionTests ‑ testSubTypeTiming

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 testSubTypeTiming to use Mockito.mockStatic and verify cached subtype checks avoid repeated uncachedIsSubtype calls.
  • Introduces a test-only CachingTestSet type 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.

@HeikoKlare HeikoKlare force-pushed the fix/reenable-testSubTypeTiming branch from 79d0ee8 to c5c6b07 Compare April 2, 2026 15:34
HeikoKlare and others added 2 commits April 11, 2026 12:28
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
@HeikoKlare HeikoKlare force-pushed the fix/reenable-testSubTypeTiming branch from c5c6b07 to 880db67 Compare April 11, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix and reenable org.eclipse.core.internal.expressions.tests.ExpressionTests.testSubTypeTiming

3 participants