If I am right about the reason, either the test should wait a bit or I need to do something with the code (I don’t know yet what). I am guessing it is probably the latter haha.
Are we supposed to buffer the incoming commands even before the replica is ready to serve them?
Thank you and I look forward to hearing from you. I have been stuck for a couple of days now.
In the meantime, I might have found out what is causing this. The issue could be that in the handshake I am also getting the REPLCONF command together with the RDB file (I didn’t expect this but I guess TCP is unpredictable). And I am reading it all in the handshake. If this is correct, I should stop at RDB file and don’t read the REPLCONF until I start handling the master connection. If that makes sense.