[GitHub] geode pull request #305: [GEODE-1923] Fix a test race condition.

2017-01-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/geode/pull/305


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] geode pull request #305: [GEODE-1923] Fix a test race condition.

2017-01-04 Thread galen-pivotal
Github user galen-pivotal commented on a diff in the pull request:

https://github.com/apache/geode/pull/305#discussion_r94660604
  
--- Diff: 
geode-core/src/test/java/org/apache/geode/internal/cache/FixedPRSinglehopDUnitTest.java
 ---
@@ -293,18 +294,23 @@ public void test_FPAmetadataFetch() {
   putIntoPartitionedRegionsThreeQs();
 
   getFromPartitionedRegionsFor3Qs();
-  Wait.pause(2000);
+  // Server 1 is actually primary for both Q1 and Q2, since there is 
no FPA server with
+  // primary set to true.
+  Awaitility.await().atMost(15, TimeUnit.SECONDS).until(
+  () -> (server1.invoke(() -> 
FixedPRSinglehopDUnitTest.primaryBucketsOnServer()) == 6)
--- End diff --

Actually scratch that, I'm going to change to the style you suggested. 👍 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] geode pull request #305: [GEODE-1923] Fix a test race condition.

2016-12-14 Thread jaredjstewart
Github user jaredjstewart commented on a diff in the pull request:

https://github.com/apache/geode/pull/305#discussion_r92525359
  
--- Diff: 
geode-core/src/test/java/org/apache/geode/internal/cache/FixedPRSinglehopDUnitTest.java
 ---
@@ -293,18 +294,23 @@ public void test_FPAmetadataFetch() {
   putIntoPartitionedRegionsThreeQs();
 
   getFromPartitionedRegionsFor3Qs();
-  Wait.pause(2000);
+  // Server 1 is actually primary for both Q1 and Q2, since there is 
no FPA server with
+  // primary set to true.
+  Awaitility.await().atMost(15, TimeUnit.SECONDS).until(
+  () -> (server1.invoke(() -> 
FixedPRSinglehopDUnitTest.primaryBucketsOnServer()) == 6)
--- End diff --

I think you can simplify the lambda expression passed to `server1.invoke()` 
by using a method reference instead:
```
() -> (server1.invoke(FixedPRSinglehopDUnitTest::primaryBucketsOnServer) == 
6)
```

If `primaryBucketsOnServer` was not a static method, it would look even 
shorter:
```
() -> (server1.invoke(this::primaryBucketsOnServer) == 6)
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] geode pull request #305: [GEODE-1923] Fix a test race condition.

2016-12-08 Thread galen-pivotal
Github user galen-pivotal commented on a diff in the pull request:

https://github.com/apache/geode/pull/305#discussion_r91569800
  
--- Diff: 
geode-core/src/test/java/org/apache/geode/internal/cache/FixedPRSinglehopDUnitTest.java
 ---
@@ -293,18 +295,24 @@ public void test_FPAmetadataFetch() {
   putIntoPartitionedRegionsThreeQs();
 
   getFromPartitionedRegionsFor3Qs();
-  Wait.pause(2000);
+  Awaitility.await().atMost(15, TimeUnit.SECONDS).until(() ->
+// Server 1 is actually primary for both Q1 and Q2, since there is 
no FPA server with
--- End diff --

@bschuchardt `./gradlew spotlessApply` wants to reduce the indent on this 
comment and the following lines to the same as the previous line... looks like 
a bug with Spotless. I'll just move the comment above the wait.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---