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 double negative nan test, ignoring sign #11506

Merged
merged 3 commits into from
Nov 15, 2022

Conversation

enjoy-binbin
Copy link
Collaborator

@enjoy-binbin enjoy-binbin commented Nov 14, 2022

The test introduced in #11482 fail on ARM (extra CI):

*** [err]: RESP2: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected '-nan' to be equal to 'nan' (context: type eval line 3 cmd
{assert_equal "-nan" [r rw.double 0 0]} proc ::test)

*** [err]: RESP3: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected ',-nan' to be equal to ',nan' (context: type eval line 8 cmd
{assert_equal ",-nan" [r rw.double 0 0]} proc ::test)

It looks like there is no nagative nan on ARM.

The test introduced in redis#11482 fail on ARM (extra CI):
```
*** [err]: RESP2: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected '-nan' to be equal to 'nan' (context: type eval line 3 cmd
{assert_equal "-nan" [r rw.double 0 0]} proc ::test)

*** [err]: RESP3: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected ',-nan' to be equal to ',nan' (context: type eval line 8 cmd
{assert_equal ",-nan" [r rw.double 0 0]} proc ::test)
```

It looks like there is no nagative nan on ARM. In this PR, we add a new
`assert_match_nocase` to do the matching, ignoring case and sign.
@enjoy-binbin
Copy link
Collaborator Author

enjoy-binbin commented Nov 14, 2022

daily module test: https://github.com/enjoy-binbin/redis/actions/runs/3460242659
@oranagra can you help me trigger the extra ci

edit: ok, i see i can also trigger the extra ci: https://github.com/enjoy-binbin/redis-extra-ci/actions/runs/3460316100

@oranagra
Copy link
Member

https://github.com/redis/redis-extra-ci/actions/runs/3460335616

i don't think you can trigger an extra-ci.. it requires a self-hosted runner

@enjoy-binbin
Copy link
Collaborator Author

yes... i see, it hung

@enjoy-binbin
Copy link
Collaborator Author

nice, all passed

Copy link
Member

@oranagra oranagra left a comment

Choose a reason for hiding this comment

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

i think we need to use * in both the positive and negative.
add a comment that on some platforms one of these can be -nan but we don't care since they are synonym.

i'm having second thoughts about my request for case-insensitive matching request.
I realize that ignoring the case in our tests means our protocol is inconclusive and may need to be changed as well.
considering this (case) wasn't a problem, maybe we should revert it?

on the other hand see this https://en.wikipedia.org/wiki/NaN#Display
maybe the issue with this is just waiting around the corner for us to test on yet another platform.
maybe we should go back on this, and modify redis to normalize all forms of NaNs (including negative) into one when generating the protocol.

@yossigo WDYT?

@enjoy-binbin
Copy link
Collaborator Author

i use * in both the positive and negative and revert the case-insensitive change. (agree with both of your comment)

modify redis to normalize all forms of NaNs (including negative) into one when generating the protocol.

this feels like a good idea.

i will do the commit (* and case one) first, and then let's wait for the discussion about the protocol

@oranagra
Copy link
Member

i'll merge this PR right away to silence the CI failures, but let's keep the discussion about which types of NaN do we document in the protocol, and if we normalize anything in redis.
for now, at least current test won't hide a protocol buy by ignoring case.

@oranagra oranagra changed the title Fix double negative nan test, ignoring character case and sign Fix double negative nan test, ignoring sign Nov 15, 2022
@oranagra oranagra merged commit a4bcdbc into redis:unstable Nov 15, 2022
@enjoy-binbin enjoy-binbin deleted the fix_nan_float_test branch November 15, 2022 15:19
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Dec 8, 2022
From https://en.wikipedia.org/wiki/NaN#Display, it says
that apart from nan and -nan, we can also get NAN and even
nan(char-sequence) from libc.

In redis#11482, our conclusion was that we wanna normalize it in
Redis to a single nan type, like we already normalized inf.

For this, we also reverted the assert_match part of the test
added in redis#11506, using assert_equal to validate the changes.
oranagra pushed a commit that referenced this pull request Dec 8, 2022
From https://en.wikipedia.org/wiki/NaN#Display, it says
that apart from nan and -nan, we can also get NAN and even
nan(char-sequence) from libc.

In #11482, our conclusion was that we wanna normalize it in
Redis to a single nan type, like we already normalized inf.

For this, we also reverted the assert_match part of the test
added in #11506, using assert_equal to validate the changes.
Mixficsol pushed a commit to Mixficsol/redis that referenced this pull request Apr 12, 2023
The test introduced in redis#11482 fail on ARM (extra CI):
```
*** [err]: RESP2: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected '-nan' to be equal to 'nan' (context: type eval line 3 cmd
{assert_equal "-nan" [r rw.double 0 0]} proc ::test)

*** [err]: RESP3: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected ',-nan' to be equal to ',nan' (context: type eval line 8 cmd
{assert_equal ",-nan" [r rw.double 0 0]} proc ::test)
```

It looks like there is no negative nan on ARM.
Mixficsol pushed a commit to Mixficsol/redis that referenced this pull request Apr 12, 2023
From https://en.wikipedia.org/wiki/NaN#Display, it says
that apart from nan and -nan, we can also get NAN and even
nan(char-sequence) from libc.

In redis#11482, our conclusion was that we wanna normalize it in
Redis to a single nan type, like we already normalized inf.

For this, we also reverted the assert_match part of the test
added in redis#11506, using assert_equal to validate the changes.
madolson pushed a commit to madolson/redis that referenced this pull request Apr 19, 2023
The test introduced in redis#11482 fail on ARM (extra CI):
```
*** [err]: RESP2: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected '-nan' to be equal to 'nan' (context: type eval line 3 cmd
{assert_equal "-nan" [r rw.double 0 0]} proc ::test)

*** [err]: RESP3: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected ',-nan' to be equal to ',nan' (context: type eval line 8 cmd
{assert_equal ",-nan" [r rw.double 0 0]} proc ::test)
```

It looks like there is no negative nan on ARM.
madolson pushed a commit to madolson/redis that referenced this pull request Apr 19, 2023
From https://en.wikipedia.org/wiki/NaN#Display, it says
that apart from nan and -nan, we can also get NAN and even
nan(char-sequence) from libc.

In redis#11482, our conclusion was that we wanna normalize it in
Redis to a single nan type, like we already normalized inf.

For this, we also reverted the assert_match part of the test
added in redis#11506, using assert_equal to validate the changes.
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
The test introduced in redis#11482 fail on ARM (extra CI):
```
*** [err]: RESP2: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected '-nan' to be equal to 'nan' (context: type eval line 3 cmd
{assert_equal "-nan" [r rw.double 0 0]} proc ::test)

*** [err]: RESP3: RM_ReplyWithDouble: NaN in tests/unit/moduleapi/reply.tcl
Expected ',-nan' to be equal to ',nan' (context: type eval line 8 cmd
{assert_equal ",-nan" [r rw.double 0 0]} proc ::test)
```

It looks like there is no negative nan on ARM.
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
From https://en.wikipedia.org/wiki/NaN#Display, it says
that apart from nan and -nan, we can also get NAN and even
nan(char-sequence) from libc.

In redis#11482, our conclusion was that we wanna normalize it in
Redis to a single nan type, like we already normalized inf.

For this, we also reverted the assert_match part of the test
added in redis#11506, using assert_equal to validate the changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants