[ https://issues.apache.org/jira/browse/GEODE-8622?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17215635#comment-17215635 ]
ASF GitHub Bot commented on GEODE-8622: --------------------------------------- sabbey37 commented on a change in pull request #5636: URL: https://github.com/apache/geode/pull/5636#discussion_r506675816 ########## File path: geode-redis/src/integrationTest/java/org/apache/geode/redis/internal/executor/string/AbstractIncrByFloatIntegrationTest.java ########## @@ -15,24 +15,25 @@ package org.apache.geode.redis.internal.executor.string; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; -import java.util.Random; +import java.math.BigDecimal; import org.junit.After; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import redis.clients.jedis.Jedis; +import redis.clients.jedis.Protocol; import org.apache.geode.test.dunit.rules.RedisPortSupplier; public abstract class AbstractIncrByFloatIntegrationTest implements RedisPortSupplier { private Jedis jedis; - private Random rand; @Before public void setUp() { - rand = new Random(); jedis = new Jedis("localhost", getPort(), 10000000); Review comment: It would be good to make this timeout the same as the one from awaitility: `Math.toIntExact(GeodeAwaitility.getTimeout().toMillis());` ########## File path: geode-redis/src/main/java/org/apache/geode/redis/internal/executor/string/IncrByFloatExecutor.java ########## @@ -46,15 +44,14 @@ public RedisResponse executeCommand(Command command, byte[] incrArray = commandElems.get(INCREMENT_INDEX); String doub = Coder.bytesToString(incrArray).toLowerCase(); if (doub.contains("inf") || doub.contains("nan")) { Review comment: Redis uses the methods `isnan` (https://en.cppreference.com/w/c/numeric/math/isnan) and `isinf` (https://en.cppreference.com/w/c/numeric/math/isinf) from the math library, which seem to check more than the string literals. Also, not all strings that contain `inf` or `nan` would produce NaN or Infinity. Some are just invalid floats. ---------------------------------------------------------------- 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 > Redis INCRBYFLOAT should return an error message consistent with native Redis > ----------------------------------------------------------------------------- > > Key: GEODE-8622 > URL: https://issues.apache.org/jira/browse/GEODE-8622 > Project: Geode > Issue Type: Improvement > Components: redis > Reporter: Jens Deppe > Priority: Major > Labels: pull-request-available > > Geode Redis: > {noformat} > 127.0.0.1:6379> set anshin-1 weeble > OK > 127.0.0.1:6379> incrbyfloat anshin-1 2.0e2f > (error) ERR Value at this key cannot be incremented numerically > {noformat} > Native Redis: > {noformat} > ERR value is not a valid float > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)