dice icon indicating copy to clipboard operation
dice copied to clipboard

Inconsistent `BITCOUNT`: BITCOUNT with start, end

Open lucifercr07 opened this issue 1 year ago • 8 comments

Steps to reproduce

Run the commands mentioned in the test on Line 68 in the file https://github.com/AshwinKul28/dice-tests/tree/main#L68.

Expected output

The expected output when the above set of commands when run on Redis

Expected '4' to be equal to '26' (context: type eval line 9 cmd {assert_equal [r bitcount s 0 -1 bit] [count_bits $s]} proc ::test)

Observed output

The observed output when the above set of commands when run on DiceDB

Expected '4' to be equal to '26' (context: type eval line 9 cmd {assert_equal [r bitcount s 0 -1 bit] [count_bits $s]} proc ::test)

The steps to run the test cases are mentioned in the README of the dice-tests repository.

Expectations for resolution

This issue will be considered resolved when the following things are done:

  1. Changes in the dice repository code to meet the expected behavior.
  2. Successful run of the tcl test behavior.

You can find the tests under the tests directory of the dice repository and the steps to run are in the README file. Refer to the following links to set up DiceDB and Redis 7.2.5 locally

lucifercr07 avatar Sep 20 '24 18:09 lucifercr07

Hi @lucifercr07 , can you assign this task to me?

Nijin-P-S avatar Sep 21 '24 04:09 Nijin-P-S

Hi @lucifercr07 Can I take this up ? Would love to work on it. Thanks

jainbhavya53 avatar Sep 21 '24 09:09 jainbhavya53

@Nijin-P-S @jainbhavya53 Assigned other issues to both of you. Let's have a single issue on your plate at a time. Once that's completed you can pick other opened issues.

AshwinKul28 avatar Sep 21 '24 10:09 AshwinKul28

Hi @AshwinKul28 Can I pick this up?

clueless-skywatcher avatar Sep 21 '24 13:09 clueless-skywatcher

@clueless-skywatcher assigned, thanks for contributing.

lucifercr07 avatar Sep 21 '24 15:09 lucifercr07

Hi @AshwinKul28 I have been trying to solve this issue for the past few days but every time I run ./tcltest I come across this issue. Please see log for details

OS: WSL2 (Ubuntu 22.04 LTS)

No directory path provided. Cloning repository...
Cloning into 'dice'...
remote: Enumerating objects: 4142, done.
remote: Counting objects: 100% (1788/1788), done.
remote: Compressing objects: 100% (552/552), done.
remote: Total 4142 (delta 1575), reused 1242 (delta 1236), pack-reused 2354 (from 1)
Receiving objects: 100% (4142/4142), 8.01 MiB | 994.00 KiB/s, done.
Resolving deltas: 100% (2768/2768), done.
Patch applied successfully.
'air' found, running 'air'...
Running tests...
Cleanup: may take some time... OK
Starting test server at port 21079
[ready]: 2114
Testing unit/auth
[1/6 done]: unit/auth (0 seconds)
Testing unit/bitpos
[exception]: Executing test client: couldn't open socket: connection refused.
couldn't open socket: connection refused
    while executing
"socket $server $port"
    (procedure "redis" line 7)
    invoked from within
"redis $::host $::port 0 $::tls"
    (procedure "run_external_server_test" line 5)
    invoked from within
"run_external_server_test $code $overrides"
    (procedure "start_server" line 61)
    invoked from within
"start_server {tags {"bitops"}} {
    test {BITCOUNT returns 0 against non existing key} {
        assert {[r bitcount no-key] == 0}
        assert {[r..."
    (file "tcltests/unit/bitpos.tcl" line 47)
    invoked from within
"source $path"
    (procedure "execute_test_file" line 4)
    invoked from within
"execute_test_file $data"
    (procedure "test_client_main" line 10)
    invoked from within
"test_client_main $::test_server_port "
Stopping the server...
Removing cloned directory 'dice'...

clueless-skywatcher avatar Sep 25 '24 16:09 clueless-skywatcher

Hello @clueless-skywatcher,

There has been no activity on this issue for the past 5 days. It would be awesome if you keep posting updates to this issue so that we know you are actively working on it.

We are really eager to close this issue at the earliest, hence if we continue to see the inactivity, we will have to reassign the issue to someone else. We are doing this to ensure that the project maintains its momentum and others are not blocked on this work.

Just drop a comment with the current status of the work or share any issues you are facing. We can always chip in to help you out.

Thanks again.

arpitbbhayani avatar Oct 03 '24 14:10 arpitbbhayani

Hi @arpitbbhayani

Thanks for reaching out. Unfortunately I haven’t been able to reproduce this issue as mentioned in the aforementioned comment.

clueless-skywatcher avatar Oct 03 '24 15:10 clueless-skywatcher

Closing, fixed as part of https://github.com/DiceDB/dice/pull/699

lucifercr07 avatar Oct 06 '24 12:10 lucifercr07