[ 
https://issues.apache.org/jira/browse/GEODE-9249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17344120#comment-17344120
 ] 

ASF GitHub Bot commented on GEODE-9249:
---------------------------------------

pivotal-jbarrett commented on a change in pull request #804:
URL: https://github.com/apache/geode-native/pull/804#discussion_r632088473



##########
File path: cppcache/integration/test/CachingProxyTest.cpp
##########
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <list>
+#include <thread>
+
+#include <gtest/gtest.h>
+
+#include <geode/Cache.hpp>
+#include <geode/CacheFactory.hpp>
+#include <geode/RegionFactory.hpp>
+#include <geode/RegionShortcut.hpp>
+#include <geode/Serializable.hpp>
+
+#include "framework/Cluster.h"
+
+using apache::geode::client::Cache;
+using apache::geode::client::Cacheable;
+using apache::geode::client::CacheableString;
+using apache::geode::client::CacheFactory;
+using apache::geode::client::Region;
+using apache::geode::client::RegionShortcut;
+using apache::geode::client::Serializable;
+
+namespace CachingProxy {
+
+class CachingProxyTest : public ::testing::Test {

Review comment:
       This is not a pattern you should ever use for testing.
   
    `Cache`, which is the root of all the components you are integration 
testing here, should NEVER have shared state between tests. It is too easy to 
end up writing tests that have indeterminate outcomes based on previous test. 
Did the test pass because the previous test put it a state it will always pass? 
Will the order of my tests change the behavior of each test?
   
   Sharing the external system, `Cluster` in this case, is arguably ok to share 
within a test fixture. I lean very heavily in not for the same reasons above. 
The previous test framework did this and many tests were inadvertently left in 
strange states because of it. 
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove(key, nullptr) Not Working Properly
> -----------------------------------------
>
>                 Key: GEODE-9249
>                 URL: https://issues.apache.org/jira/browse/GEODE-9249
>             Project: Geode
>          Issue Type: Bug
>          Components: native client
>            Reporter: Michael Martell
>            Priority: Major
>              Labels: pull-request-available
>
> The Region API supports both local and remote operations. Local operations 
> apply to CACHING_PROXY regions and are supposed to affect only the local 
> cache. However, localInvalidate(key, value) invalidates both local and remote 
> entry.
>  
> This is actually a but in remove(key, nullptr), not localInvalidate.
>  
> Note: Invalidate operations sets the value for the given key to null.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to