You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2021/11/02 23:50:43 UTC
[GitHub] [geode] dschneider-pivotal opened a new pull request #7073: GEODE-9671: fixed test's expectations
dschneider-pivotal opened a new pull request #7073:
URL: https://github.com/apache/geode/pull/7073
<!-- Thank you for submitting a contribution to Apache Geode. -->
<!-- In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
-->
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
- [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
- [ ] Is your initial contribution a single, squashed commit?
- [ ] Does `gradlew build` run cleanly?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
<!-- Note:
Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.
-->
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] DonalEvans commented on a change in pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
DonalEvans commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741549375
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
`isConcurrentExecution` and `withPrimaryCrash` seem to be mutually exclusive in this method. If someone tries to call this method with both set to true, no verification will be done at all, so maybe the if statement should have a branch for both being true (maybe that just throws an exception) just to cover all the bases?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] DonalEvans commented on a change in pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
DonalEvans commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741549375
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
`isConcurrentExecution` and `withPrimaryCrash` seem to be mutually exclusive in this method. If someone tries to call this method with both set to true, no verification will be done at all, so maybe the if statement should have a branch for both being true (maybe that just throws an exception) just to cover all the bases?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] dschneider-pivotal merged pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
dschneider-pivotal merged pull request #7073:
URL: https://github.com/apache/geode/pull/7073
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] dschneider-pivotal commented on a change in pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
dschneider-pivotal commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741643941
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
fixed
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] dschneider-pivotal merged pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
dschneider-pivotal merged pull request #7073:
URL: https://github.com/apache/geode/pull/7073
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] dschneider-pivotal merged pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
dschneider-pivotal merged pull request #7073:
URL: https://github.com/apache/geode/pull/7073
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] DonalEvans commented on a change in pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
DonalEvans commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741549375
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
`isConcurrentExecution` and `withPrimaryCrash` seem to be mutually exclusive in this method. If someone tries to call this method with both set to true, no verification will be done at all, so maybe the if statement should have a branch for both being true (maybe that just throws an exception) just to cover all the bases?
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] dschneider-pivotal commented on a change in pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
dschneider-pivotal commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741643941
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
fixed
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [geode] dschneider-pivotal commented on a change in pull request #7073: GEODE-9671: fixed test's expectations
Posted by GitBox <gi...@apache.org>.
dschneider-pivotal commented on a change in pull request #7073:
URL: https://github.com/apache/geode/pull/7073#discussion_r741643941
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
fixed
##########
File path: geode-for-redis/src/distributedTest/java/org/apache/geode/redis/internal/executor/sortedset/ZAddIncrOptionDUnitTest.java
##########
@@ -84,25 +83,35 @@ public void tearDown() {
@Test
public void zAddWithIncrOptionCanAddAndIncrementScoresConcurrently() {
new ConcurrentLoopingThreads(setSize,
- (i) -> doZAddIncr(i, increment1, total, true),
- (i) -> doZAddIncr(i, increment2, total, true)).run();
+ (i) -> doZAddIncr(i, increment1, total, true, false),
+ (i) -> doZAddIncr(i, increment2, total, true, false)).run();
assertThat(jedis.zcard(sortedSetKey)).isEqualTo(setSize);
- verifyZScores();
+ verifyZScores(false);
}
- private void verifyZScores() {
+ private void verifyZScores(boolean withPrimaryCrash) {
for (int i = 0; i < setSize; i++) {
- assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ if (withPrimaryCrash) {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isIn(total, total + increment2);
+ } else {
+ assertThat(jedis.zscore(sortedSetKey, baseMemberName + i)).isEqualTo(total);
+ }
}
}
- private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution) {
+ private void doZAddIncr(int i, double increment, double total, boolean isConcurrentExecution,
+ boolean withPrimaryCrash) {
Review comment:
fixed
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@geode.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org