Code Monkey home page Code Monkey logo

Comments (11)

joelcox avatar joelcox commented on May 18, 2024

I wrote some thorough tests for _encode_request in 0c52347, but _read_request() is currently untestable on its own. Some smoke tests are still in place, which I fleshed out a bit.

from codeigniter-redis.

tinkertim avatar tinkertim commented on May 18, 2024

I just threw a DEBUG SEGFAULT, we need to handle the socket closing unexpectedly. Ouch.

from codeigniter-redis.

joelcox avatar joelcox commented on May 18, 2024

How can this be reproduced? Shutting down redis-server in the middle of a request?

from codeigniter-redis.

tinkertim avatar tinkertim commented on May 18, 2024

By closing the socket randomly if a variable is passed to the constructor (which would only happen in test cases). Otherwise, it's just a check against NULL, perhaps if some constant is defined.

from codeigniter-redis.

tinkertim avatar tinkertim commented on May 18, 2024

Redis not working is recoverable in some instances. I need to have a think about how to handle it, and the 'how' could be tested :)

from codeigniter-redis.

joelcox avatar joelcox commented on May 18, 2024

So by creating multiple instances of the Redis class? Sorry, I'm not following you.

from codeigniter-redis.

tinkertim avatar tinkertim commented on May 18, 2024

Sorry, this would be more work than worth it. What I was hoping to be able to do is handle (gracefully) instances where Redis just dies. You can see it's a bit icky by adding a temporary method to close the socket midway through, so I thought of adding a user defined callback (also handy for testing) that could tell an app to stop using Redis.

More overhead and work than it's really worth at present especially for a library that implements the entire command set without any actual concrete methods :)

from codeigniter-redis.

tinkertim avatar tinkertim commented on May 18, 2024

I'll add proper tests for transactions shortly (though those are mostly integration tests), I need to tickle WATCH during transactions as well. I'm quite happy at this point, everything 'just works' :)

from codeigniter-redis.

joelcox avatar joelcox commented on May 18, 2024

Haha. Great job.

from codeigniter-redis.

tinkertim avatar tinkertim commented on May 18, 2024

Well, I went through and tried various commands in various scenarios differently and everything works (or fails) as expected. But really, all we're doing beyond what we have is testing Redis itself, which Redis does quite a good job of doing already :)

I can properize a simple test for transactions if you really want to include them. But honestly, the tests we have seem sufficient. We'll know quickly if a change broke encoding / decoding of the wire protocol .. anything else is really just exercising Redis.

from codeigniter-redis.

joelcox avatar joelcox commented on May 18, 2024

Agreed. I think we covered most (if not all) the encoding cases. Everything else is beyond our responsibility. I'll close this for now.

from codeigniter-redis.

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.