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

    51 files   -   3      51 suites   - 3   35m 47s ⏱️ -34s
 4 556 tests ±  0   4 413 ✅ ±  0   22 💤  - 1  28 ❌ ±0  93 🔥 +1 
12 076 runs   - 153  11 798 ✅  - 151  156 💤  - 3  29 ❌ ±0  93 🔥 +1 

For more details on these failures and errors, see this check.

Results for commit c5c6b07. ± Comparison against base commit 0b722c8.

♻️ 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 and others added 2 commits April 2, 2026 17:34
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 79d0ee8 to c5c6b07 Compare April 2, 2026 15:34
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