Please explain how the #YG4 is tested

Can anyone give me an exact step-by-step description of how I can reproduce the test locally?

I dont want anything else except for HOW to do it. I sometimes pass the test and I sometimes fail the test, and I’ve no clue why. Running the codecrafters test is a very difficult way of debugging.

SO PLEASE JUST LET ME KNOW.

Am I on the right track?

Master Server

./your_program.sh

Slave server

./your_program.sh –-port 6380 –-replicaof “localhost 6379”

The way I am trying to achieve it is by:
echo "SET foo 123

SET bar 456

SET baz 789" > commands.txt

And then

cat commands.txt | redis-cli -p 6379 --pipe

Is this reasonable? Thank you

Hey @gimmy1, looks like you’re running into the same issue as in the previous post.

Can anyone give me an exact step-by-step description of how I can reproduce the test locally?

You can check out the exact tests for #YG4 here.

It can be tricky to reproduce the tests (especially with non-deterministic TCP reads) outside our environment, but I do have a workaround that might help trigger the issue you’re seeing.

I dont want anything else except for HOW to do it.

Let me know if you’d like to hear about the workaround.

@andy1li I would like to see the workaround. Thank you.

@gimmy1 Looks like you’ve resolved the issue by Stripping RDB from buffer.

The workaround is to first start the official redis-server, and then launch your replica in a separate terminal:

Let me know if you run into other issues!

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

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