Comments (11)
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.
I just threw a DEBUG SEGFAULT
, we need to handle the socket closing unexpectedly. Ouch.
from codeigniter-redis.
How can this be reproduced? Shutting down redis-server
in the middle of a request?
from codeigniter-redis.
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.
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.
So by creating multiple instances of the Redis class? Sorry, I'm not following you.
from codeigniter-redis.
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.
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.
Haha. Great job.
from codeigniter-redis.
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.
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)
- _auth returns "invalid password" when $password === '' HOT 3
- In the Constructor, connection error should show $config['port'] HOT 1
- Some data does not properly return from redis HOT 6
- Set json string as value HOT 5
- test_empty_hash_values fails after changing bulk reply code HOT 8
- The library sometimes returns OK when getting data HOT 3
- Unable to connect to redis with a correct password HOT 7
- Cannot get limit to work - could be related to spaces?
- mget have no return and aways waiting
- _multi_bulk_reply is not working
- Redis pipeline - batch get HOT 4
- multi & exec hmget failed HOT 5
- method _bulk_reply is not returning the correct data HOT 3
- Deprecating this library HOT 2
- No way to check if redis is running HOT 4
- Any Support for Codeigniter 3+
- 使用scan命令时返回值出错
- How can i set time for expire. HOT 3
- $this->redis->command('PING'); Error :: command On null()
- How can i use this in cli? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codeigniter-redis.