Tests not being consistent

I don’t know if I will categorized this as a bug but I don’t know a better place to put this.

I am currently on the Redis challenge and I have noticed that the test cases are not always the same, and this have caused me to pass a stage, and then, when implementing the next one, due to this variability on tests, the previous one won’t pass make it a little bit harder to debug.

Also I have another problem, in one of the earlier stages, once in a while, it fails, and since I don’t have a proper way of looking into this error, I don’t really know what is going on there and what I have to fix. I just re-run the test and it succeds.

Hi @i27ae15, inconsistent test results across multiple runs are likely caused by race conditions.

For context, our tester is rigorously tested against the official Redis server, so the chances of variability originating from our tester are minimal.

Could you please share the names of the stages where you’re encountering issues?

Hi @andy1li, first of all, thank you very much for answering and for the great work you all have put in Codecrafters.

I can give you an example of what I meant, on the keys tages, on Set command, I have found that the keys vary, sometimes it might be SET mango someValue or SET strawberry someValue this gave a me little issue due to the way I was taking the bytes after the dollar sign (in mango you got one digit ($5) and in strawberry you go two ($10) happening to sometimes the test not passing.

On the stage I am having the issue sometimes is - Command Processing #YG4 - I don’t think this is a race condition, I think I can say that this is being well handled by my program (although I can always be wrong). I was having a string to integer convertion error, I think I have solved this issue but not sure, since sometimes I still have some error on this stage.

on the keys tages, on Set command, I have found that the keys vary, sometimes it might be SET mango someValue or SET strawberry someValue this gave a me little issue due to the way I was taking the bytes after the dollar sign (in mango you got one digit ($5) and in strawberry you go two ($10) happening to sometimes the test not passing.

Oh, this is actually expected behavior: the randomized test for keys and values simulates how a real user might write and read different data from your Redis server.

On the stage I am having the issue sometimes is - Command Processing #YG4. I was having a string to integer convertion error

I tried running your code multiple times but couldn’t reproduce the error. If you encounter it again, feel free to share a screenshot or the details here!

Thanks for you reply, I will bring the issue if I find it again!

For anyone interested: I just solved this, I was processing an empty buffer, something that was happening once every 10 runs or something like that.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.