Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 4/6 problems in JCache1.1.0 TCK #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix 4/6 problems in JCache1.1.0 TCK #11

wants to merge 2 commits into from

Conversation

SharplEr
Copy link
Owner

@SharplEr SharplEr commented May 25, 2018

I have tested our current master with JCache TCK 1.1.0 fix some problems, and prepared following summary:

Summary

Total failed tests: 104.
A number of different problems: 6.
Problems which will break TCK 1.0.1 after fix: 2 (have tested).

Problem 1 (not done): Problems with Closeable objects from Factory.

According to spec Cache.close() should clean up all Closeable objects created by following factories: CacheLoader, CacheWriter, CacheEntryListener, ExpiryPolicy.
And in TCK 1.0.1 there are no such tests. But in TCK 1.1.0 there are checks for it. And Ignite fails it because hasn't such functionality.

List of test classes in TCK:

  1. CacheListenerTest
  2. CacheExpiryTest
  3. CacheLoaderTest
  4. CacheLoaderWithExpiryTest
  5. CacheLoaderWithoutReadThroughTest
  6. CacheLoaderWriterTest
  7. CacheWriterTest

Problem 2 (done): CacheManagerTest.close_cachesEmpty

Method CacheManager.getCacheNames() should throw IllegalStateException in case when CacheManager is closed. But in TCK 1.0.1 test CacheManagerTest.close_cachesEmpty expect empty list, which was incorrect according to spec.
In TCK 1.1.0 test is fixed.
It was known problem, please see comments in CacheManager#getCacheNames() on current master.
But we can't make this test pass in both versions of TCK.

Link: jsr107/jsr107tck#87
Failed tests: 1.
Changing in RI for example: https://github.com/jsr107/RI/pull/49/files
Break TCK for 1.0.1: Yes. New test expects Exception, but old test expects empty list.
Fix trivial: Yes. See CacheManager#getCacheNames().

Problem 3 (done): CacheMBStatisticsBeanTest.testClear

CacheStatisticsMXBean.clear() was never tested. Now it is.

Link: jsr107/jsr107tck#101
Failed tests: 1.
Changing in RI for example: ----
Break TCK for 1.0.1: No.
Fix trivial: Yes. See CacheClusterMetricsMXBeanImpl#clear()

Problem 4 (not done): CacheEntryEvent.getOldValue should be available

Link:

Failed tests: 2.
List of tests:

  • CacheListenerTest.testFilteredListener
  • CacheListenerTest.testCacheEntryListener

Changing in RI for example: ----
Break TCK for 1.0.1: Should not.
Fix trivial: No. See CacheContinuousQueryManager#existingEntries. Need somehow restore old value from entry event. Required to redesign continuous query a bit. I believe more experienced contributors will want to design it.

Problem 5 (done): CacheManagerTest.getUnsafeTypedCacheRequest

Link:

Failed tests: 1.
Changing in RI for example: ----
Break TCK for 1.0.1: No.
Fix trivial: Yes. See CacheManager#getCache()

Problem 6 (done): CacheMBStatisticsBeanTest.testPutIfAbsent -- putIfAbsent doesn't update hit/miss statistics.

Link: jsr107/jsr107tck#63
Failed tests: 1.
Changing in RI for example: ----
Break TCK for 1.0.1: Yes. New test expects 1, but old test expects 0 in the same situation.
Fix trivial: Yes. See GridCacheMapEntry.innerUpdate()

@@ -453,7 +453,7 @@
<artifactItem>
<groupId>javax.cache</groupId>
<artifactId>app-domain</artifactId>
<version>${javax.cache.tck.version}</version>
<version>${javax.cache.version}</version>
Copy link
Owner Author

Choose a reason for hiding this comment

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

A simple bug in current pom file, which is hidden in master. You can restore this change and will see the problem.

@@ -78,7 +78,7 @@
<jackson2.version>2.6.5</jackson2.version>
<javassist.version>3.20.0-GA</javassist.version>
<javax.cache.bundle.version>1.0.0_1</javax.cache.bundle.version>
<javax.cache.tck.version>1.0.1</javax.cache.tck.version>
<javax.cache.tck.version>1.1.0</javax.cache.tck.version>
Copy link
Owner Author

Choose a reason for hiding this comment

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

Update TCK version to 1.1.0

cctx.cache().metrics0().onRead(oldVal != null);
}
needVal)
cctx.cache().metrics0().onRead(oldVal != null);
Copy link
Owner Author

@SharplEr SharplEr May 25, 2018

Choose a reason for hiding this comment

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

Fix problem with CacheMBStatisticsBeanTest.testPutIfAbsent
jsr107/jsr107tck#124

@@ -251,7 +251,7 @@

/** {@inheritDoc} */
@Override public void clear() {
throw new UnsupportedOperationException("Cluster metrics can't be cleared. Use local metrics clear instead.");
cache.metrics.clear();
Copy link
Owner Author

Choose a reason for hiding this comment

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

Fix problem with CacheMBStatisticsBeanTest.testClear.
jsr107/jsr107tck#101

@@ -258,8 +250,7 @@ public CacheManager(URI uri, CachingProvider cachingProvider, ClassLoader clsLdr

try {
if (kernalGateway.getState() != GridKernalState.STARTED)
return Collections.emptySet(); // javadoc of #getCacheNames() says that IllegalStateException should be
// thrown but CacheManagerTest.close_cachesEmpty() require empty collection.
throw new IllegalStateException();
Copy link
Owner Author

Choose a reason for hiding this comment

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

Fix problem with CacheManagerTest.close_cachesEmpty
jsr107/jsr107tck#87
https://github.com/jsr107/RI/pull/49/files

@@ -221,14 +221,6 @@ public CacheManager(URI uri, CachingProvider cachingProvider, ClassLoader clsLdr
try {
IgniteCache<K, V> cache = getCache0(cacheName);

if (cache != null) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

Fix problem with CacheManagerTest.getUnsafeTypedCacheRequest
jsr107/jsr107spec#340
jsr107/jsr107tck#83

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.

1 participant