Giter Club home page Giter Club logo

Comments (5)

reneklacan avatar reneklacan commented on May 26, 2024 1

@mattbrictson ah, you are right, I completely forgot we use fakeredis and not a real one. Created PR to fix this issue and also to stop using fakeredis

from rollout.

reneklacan avatar reneklacan commented on May 26, 2024 1

Released as part of 2.4.6

from rollout.

mattbrictson avatar mattbrictson commented on May 26, 2024

Perhaps related, if I run bundle update on the rollout repository itself and run rspec, rollout's specs currently fail:

Failures:

  1) Rollout Check if feature exists it should return true if the feature is exist
     Failure/Error: @storage.exists(key(feature))
     
     NoMethodError:
       undefined method `>' for true:TrueClass
     # ./lib/rollout.rb:299:in `exists?'
     # ./spec/rollout_spec.rb:669:in `block (3 levels) in <top (required)>'

  2) Rollout Check if feature exists it should return false if the feature is not exist
     Failure/Error: @storage.exists(key(feature))
     
     NoMethodError:
       undefined method `>' for false:FalseClass
     # ./lib/rollout.rb:299:in `exists?'
     # ./spec/rollout_spec.rb:673:in `block (3 levels) in <top (required)>'

Finished in 0.58978 seconds (files took 0.16322 seconds to load)
83 examples, 2 failures

Failed examples:

rspec ./spec/rollout_spec.rb:667 # Rollout Check if feature exists it should return true if the feature is exist
rspec ./spec/rollout_spec.rb:672 # Rollout Check if feature exists it should return false if the feature is not exist

Edit: this is unrelated. It is a separate bug in fakeredis.

from rollout.

reneklacan avatar reneklacan commented on May 26, 2024

@mattbrictson thank you for opening the issue.

I would be happy to fix it but that error is actually coming from the redis-rb gem itself from

From: /Users/rene/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/redis-4.2.1/lib/redis.rb:606 Redis#exists?:

    603: def exists?(*keys)
    604:   synchronize do |client|
    605:     client.call([:exists, *keys]) do |value|
 => 606:       value > 0
    607:     end
    608:   end
    609: end

[2] pry(#<Redis>)> value
=> true

value is boolean and they are comparing it with 0

If I'm not mistaken, they first need to actually fix #exists? method before we can update rollout.

from rollout.

mattbrictson avatar mattbrictson commented on May 26, 2024

I think that is actually due to a bug in fakeredis. If you use the redis 4.2.1 gem directly (i.e. without loading fakeredis), it works as expected:

$ irb
>> require "redis"
true
>> Redis::VERSION
"4.2.1"
>> redis = Redis.new(uri: "redis://127.0.0.1/1")
>> redis.exists?("foo")
false
>> 

If you load fakeredis, that is when the error occurs:

$ irb
>> require "redis"
true
>> require "fakeredis"
true
>> redis = Redis.new(uri: "redis://127.0.0.1/1")
>> redis.exists?("foo")
NoMethodError (undefined method `>' for false:FalseClass)

from rollout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.