[tester::#YG4] Running tests for Stage #YG4 (Replication - Command Processing)
[tester::#YG4] Master is running on port 6379
[tester::#YG4] $ ./spawn_redis_server.sh --port 6380 --replicaof "localhost 6379"
[your_program] warning: clauses with the same name and arity (number of arguments) should be grouped together, "defp execute_command/3" was previously defined (lib/server.ex:535)
[your_program] │
[your_program] 572 │ defp execute_command("ECHO", [message], client) do
[your_program] │ ~
[your_program] │
[your_program] └─ lib/server.ex:572:8
[your_program]
[your_program] Server listening on port 6380
[tester::#YG4] [handshake] master: Waiting for replica to initiate handshake with "PING" command
[your_program] Socket state before handshake: [recv_oct: 0, recv_cnt: 0, recv_max: 0, recv_avg: 0, recv_dvi: 0, send_oct: 0, send_cnt: 0, send_max: 0, send_avg: 0, send_pend: 0]
[tester::#YG4] [handshake] master: Received bytes: "*1\r\n$4\r\nPING\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["PING"]
[tester::#YG4] [handshake] Received ["PING"]
[tester::#YG4] [handshake] master: Sent "PONG"
[tester::#YG4] [handshake] master: Sent bytes: "+PONG\r\n"
[tester::#YG4] [handshake] master: Waiting for replica to send "REPLCONF listening-port 6380" command
[your_program]
[your_program] 16:55:22.237 [debug] Received raw bytes: <<43, 80, 79, 78, 71, 13, 10>>
[your_program]
[your_program] 16:55:22.239 [debug] Received expected response
[tester::#YG4] [handshake] master: Received bytes: "*3\r\n$8\r\nREPLCONF\r\n$14\r\nlistening-port\r\n$4\r\n6380\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["REPLCONF", "listening-port", "6380"]
[tester::#YG4] [handshake] Received ["REPLCONF", "listening-port", "6380"]
[tester::#YG4] [handshake] master: Sent "OK"
[tester::#YG4] [handshake] master: Sent bytes: "+OK\r\n"
[tester::#YG4] [handshake] master: Waiting for replica to send "REPLCONF capa" command
[tester::#YG4] [handshake] master: Received bytes: "*3\r\n$8\r\nREPLCONF\r\n$4\r\ncapa\r\n$6\r\npsync2\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["REPLCONF", "capa", "psync2"]
[tester::#YG4] [handshake] Received ["REPLCONF", "capa", "psync2"]
[your_program]
[your_program] 16:55:22.248 [debug] Received raw bytes: <<43, 79, 75, 13, 10>>
[your_program]
[your_program] 16:55:22.248 [debug] Received expected response
[tester::#YG4] [handshake] master: Sent "OK"
[tester::#YG4] [handshake] master: Sent bytes: "+OK\r\n"
[tester::#YG4] [handshake] master: Waiting for replica to send "PSYNC" command
[tester::#YG4] [handshake] master: Received bytes: "*3\r\n$5\r\nPSYNC\r\n$1\r\n?\r\n$2\r\n-1\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["PSYNC", "?", "-1"]
[tester::#YG4] [handshake] Received ["PSYNC", "?", "-1"]
[your_program]
[your_program] 16:55:22.249 [debug] Received raw bytes: <<43, 79, 75, 13, 10>>
[your_program]
[your_program] 16:55:22.249 [debug] Received expected response
[tester::#YG4] [handshake] master: Sent "FULLRESYNC 75cd7bc10c49047e0d163660f3b90625b1af31dc 0"
[tester::#YG4] [handshake] master: Sent bytes: "+FULLRESYNC 75cd7bc10c49047e0d163660f3b90625b1af31dc 0\r\n"
[tester::#YG4] [handshake] Sending RDB file...
[tester::#YG4] [handshake] master: Sent bytes: "$88\r\nREDIS0011\xfa\tredis-ver\x057.2.0\xfa\nredis-bits\xc0@\xfa\x05ctime\xc2m\b\xbce\xfa\bused-mem°\xc4\x10\x00\xfa\baof-base\xc0\x00\xff\xf0n;\xfe\xc0\xffZ\xa2"
[tester::#YG4] [handshake] Sent RDB file.
[tester::#YG4] [propagation] master: > SET foo 123
[tester::#YG4] [propagation] master: Sent bytes: "*3\r\n$3\r\nSET\r\n$3\r\nfoo\r\n$3\r\n123\r\n"
[tester::#YG4] [propagation] master: > SET bar 456
[tester::#YG4] [propagation] master: Sent bytes: "*3\r\n$3\r\nSET\r\n$3\r\nbar\r\n$3\r\n456\r\n"
[tester::#YG4] [propagation] master: > SET baz 789
[tester::#YG4] [propagation] master: Sent bytes: "*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[tester::#YG4] [test] Getting key foo
[tester::#YG4] [test] client: $ redis-cli GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program]
[your_program] 16:55:22.251 [debug] Received PSYNC response: <<43, 70, 85, 76, 76, 82, 69, 83, 89, 78, 67, 32, 55, 53, 99, 100, 55, 98, 99, 49, 48, 99, 52, 57, 48, 52, 55, 101, 48, 100, 49, 54, 51, 54, 54, 48, 102, 51, 98, 57, 48, 54, 50, 53, 98, 49, 97, 102, 51, 49, 100, 99, 32, 48, 13, 10>>
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program]
[your_program] 16:55:22.255 [debug] PSYNC successful. Replication ID: 75cd7bc10c49047e0d163660f3b90625b1af31dc, Offset: 0
[your_program]
[your_program] 16:55:22.255 [info] Starting to receive data from socket
[your_program]
[your_program] 16:55:22.255 [debug] Receiving data. Buffer size: 0, Expected length: 0
[your_program]
[your_program] 16:55:22.256 [debug] Received raw bytes: <<36, 56, 56, 13, 10, 82, 69, 68, 73, 83, 48, 48, 49, 49, 250, 9, 114, 101, 100, 105, 115, 45, 118, 101, 114, 5, 55, 46, 50, 46, 48, 250, 10, 114, 101, 100, 105, 115, 45, 98, 105, 116, 115, 192, 64, 250, 5, 99, 116, 105, 109, 101, 194, 109, 8, 188, 101, 250, 8, 117, 115, 101, 100, 45, 109, 101, 109, 194, 176, 196, 16, 0, 250, 8, 97, 111, 102, 45, 98, 97, 115, 101, 192, 0, 255, 240, 110, 59, 254, 192, 255, 90, 162, 42, 51, 13, 10, 36, 51, 13, 10, 83, 69, 84, 13, 10, 36, 51, 13, 10, 102, 111, 111, 13, 10, 36, 51, 13, 10, 49, 50, 51, 13, 10, 42, 51, 13, 10, 36, 51, 13, 10, 83, 69, 84, 13, 10, 36, 51, 13, 10, 98, 97, 114, 13, 10, 36, 51, 13, 10, 52, 53, 54, 13, 10, 42, 51, 13, 10, 36, 51, 13, 10, 83, 69, 84, 13, 10, 36, 51, 13, 10, 98, 97, 122, 13, 10, 36, 51, 13, 10, 55, 56, 57, 13, 10>>
[your_program]
[your_program] 16:55:22.256 [debug] Received chunk of size: 186 bytes
[your_program]
[your_program] 16:55:22.256 [debug] Received data (as string): <<36, 56, 56, 13, 10, 82, 69, 68, 73, 83, 48, 48, 49, 49, 250, 9, 114, 101, 100, 105, 115, 45, 118, 101, 114, 5, 55, 46, 50, 46, 48, 250, 10, 114, 101, 100, 105, 115, 45, 98, 105, 116, 115, 192, 64, 250, 5, 99, 116, 105, ...>>
[your_program]
[your_program] 16:55:22.256 [debug] New buffer size: 186 bytes
[your_program]
[your_program] 16:55:22.256 [debug] Parsing data starting with '$'
[your_program]
[your_program] 16:55:22.256 [info] Found RDB length indicator: 88 bytes
[your_program]
[your_program] 16:55:22.257 [debug] Received enough data to potentially complete RDB or command
[your_program]
[your_program] 16:55:22.257 [info] RDB file complete, parsing remaining data as command
[your_program]
[your_program] 16:55:22.257 [info] Received data: "*3\r\n$3\r\nSET\r\n$3\r\nfoo\r\n$3\r\n123\r\n*3\r\n$3\r\nSET\r\n$3\r\nbar\r\n$3\r\n456\r\n*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"...
[your_program]
[your_program] 16:55:22.257 [debug] Attempting to parse commands from data
[your_program]
[your_program] 16:55:22.257 [debug] Parsing data: "*3\r\n$3\r\nSET\r\n$3\r\nfoo\r\n$3\r\n123\r\n*3\r\n$3\r\nSET\r\n$3\r\nbar\r\n$3\r\n456\r\n*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[your_program]
[your_program] 16:55:22.257 [debug] Parsed command: ["SET", "foo", "123"], remaining: "*3\r\n$3\r\nSET\r\n$3\r\nbar\r\n$3\r\n456\r\n*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[your_program]
[your_program] 16:55:22.257 [debug] Parsing data: "*3\r\n$3\r\nSET\r\n$3\r\nbar\r\n$3\r\n456\r\n*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[your_program]
[your_program] 16:55:22.257 [debug] Parsed command: ["SET", "bar", "456"], remaining: "*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[your_program]
[your_program] 16:55:22.257 [debug] Parsing data: "*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[your_program]
[your_program] 16:55:22.257 [debug] Parsed command: ["SET", "baz", "789"], remaining: ""
[your_program]
[your_program] 16:55:22.257 [debug] Finished parsing all commands: [["SET", "foo", "123"], ["SET", "bar", "456"], ["SET", "baz", "789"]]
[your_program]
[your_program] 16:55:22.257 [info] Successfully parsed commands: [["SET", "foo", "123"], ["SET", "bar", "456"], ["SET", "baz", "789"]]
[your_program]
[your_program] 16:55:22.257 [info] Received complete command: [["SET", "foo", "123"], ["SET", "bar", "456"], ["SET", "baz", "789"]]
[your_program]
[your_program] 16:55:22.257 [info] Executing command: ["SET", "foo", "123"]
[tester::#YG4] [test] client: Received bytes: "$3\r\n123\r\n"
[tester::#YG4] [test] client: Received RESP bulk string: "123"
[your_program] Executing GET command for key: foo
[your_program] Value found: 123
[your_program]
[your_program] 16:55:22.264 [info] Executing command: ["SET", "bar", "456"]
[your_program]
[your_program] 16:55:22.264 [info] Executing command: ["SET", "baz", "789"]
[your_program] Socket state after handshake: [recv_oct: 259, recv_cnt: 5, recv_max: 186, recv_avg: 51, recv_dvi: 34, send_oct: 133, send_cnt: 4, send_max: 49, send_avg: 33, send_pend: 0]
[your_program] Process the received data carefully
[your_program]
[your_program] 16:55:22.264 [info] Handshake completed successfully
[tester::#YG4] [test] Received "123"
[tester::#YG4] [test] Getting key bar
[tester::#YG4] [test] client: > GET bar
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nbar\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nbar\r\n"
[your_program] Parsed data: ["GET", "bar"]
[your_program] Executing GET command for key: bar
[your_program] Value found: 456
[tester::#YG4] [test] client: Received bytes: "$3\r\n456\r\n"
[tester::#YG4] [test] client: Received RESP bulk string: "456"
[tester::#YG4] [test] Received "456"
[tester::#YG4] [test] Getting key baz
[tester::#YG4] [test] client: > GET baz
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nbaz\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nbaz\r\n"
[your_program] Parsed data: ["GET", "baz"]
[your_program] Executing GET command for key: baz
[your_program] Value found: 789
[tester::#YG4] [test] client: Received bytes: "$3\r\n789\r\n"
[tester::#YG4] [test] client: Received RESP bulk string: "789"
[tester::#YG4] [test] Received "789"
[tester::#YG4] Test passed.
[tester::#YG4] Terminating program
[your_program]
[your_program] 16:55:22.270 [notice] SIGTERM received - shutting down
[your_program]
[tester::#YG4] Program terminated successfully
and
#---------------------------------
but when the test is failing these are the logs
[tester::#YG4] [handshake] master: Waiting for replica to initiate handshake with "PING" command
[your_program] Socket state before handshake: [recv_oct: 0, recv_cnt: 0, recv_max: 0, recv_avg: 0, recv_dvi: 0, send_oct: 0, send_cnt: 0, send_max: 0, send_avg: 0, send_pend: 0]
[tester::#YG4] [handshake] master: Received bytes: "*1\r\n$4\r\nPING\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["PING"]
[tester::#YG4] [handshake] Received ["PING"]
[tester::#YG4] [handshake] master: Sent "PONG"
[tester::#YG4] [handshake] master: Sent bytes: "+PONG\r\n"
[tester::#YG4] [handshake] master: Waiting for replica to send "REPLCONF listening-port 6380" command
[your_program]
[your_program] 17:32:17.177 [debug] Received raw bytes: <<43, 80, 79, 78, 71, 13, 10>>
[your_program]
[your_program] 17:32:17.180 [debug] Received expected response
[tester::#YG4] [handshake] master: Received bytes: "*3\r\n$8\r\nREPLCONF\r\n$14\r\nlistening-port\r\n$4\r\n6380\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["REPLCONF", "listening-port", "6380"]
[tester::#YG4] [handshake] Received ["REPLCONF", "listening-port", "6380"]
[tester::#YG4] [handshake] master: Sent "OK"
[tester::#YG4] [handshake] master: Sent bytes: "+OK\r\n"
[tester::#YG4] [handshake] master: Waiting for replica to send "REPLCONF capa" command
[tester::#YG4] [handshake] master: Received bytes: "*3\r\n$8\r\nREPLCONF\r\n$4\r\ncapa\r\n$6\r\npsync2\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["REPLCONF", "capa", "psync2"]
[tester::#YG4] [handshake] Received ["REPLCONF", "capa", "psync2"]
[your_program]
[your_program] 17:32:17.187 [debug] Received raw bytes: <<43, 79, 75, 13, 10>>
[your_program]
[your_program] 17:32:17.187 [debug] Received expected response
[tester::#YG4] [handshake] master: Sent "OK"
[tester::#YG4] [handshake] master: Sent bytes: "+OK\r\n"
[tester::#YG4] [handshake] master: Waiting for replica to send "PSYNC" command
[tester::#YG4] [handshake] master: Received bytes: "*3\r\n$5\r\nPSYNC\r\n$1\r\n?\r\n$2\r\n-1\r\n"
[tester::#YG4] [handshake] master: Received RESP array: ["PSYNC", "?", "-1"]
[tester::#YG4] [handshake] Received ["PSYNC", "?", "-1"]
[your_program]
[your_program] 17:32:17.189 [debug] Received raw bytes: <<43, 79, 75, 13, 10>>
[your_program]
[your_program] 17:32:17.189 [debug] Received expected response
[tester::#YG4] [handshake] master: Sent "FULLRESYNC 75cd7bc10c49047e0d163660f3b90625b1af31dc 0"
[tester::#YG4] [handshake] master: Sent bytes: "+FULLRESYNC 75cd7bc10c49047e0d163660f3b90625b1af31dc 0\r\n"
[tester::#YG4] [handshake] Sending RDB file...
[tester::#YG4] [handshake] master: Sent bytes: "$88\r\nREDIS0011\xfa\tredis-ver\x057.2.0\xfa\nredis-bits\xc0@\xfa\x05ctime\xc2m\b\xbce\xfa\bused-mem°\xc4\x10\x00\xfa\baof-base\xc0\x00\xff\xf0n;\xfe\xc0\xffZ\xa2"
[tester::#YG4] [handshake] Sent RDB file.
[tester::#YG4] [propagation] master: > SET foo 123
[tester::#YG4] [propagation] master: Sent bytes: "*3\r\n$3\r\nSET\r\n$3\r\nfoo\r\n$3\r\n123\r\n"
[tester::#YG4] [propagation] master: > SET bar 456
[tester::#YG4] [propagation] master: Sent bytes: "*3\r\n$3\r\nSET\r\n$3\r\nbar\r\n$3\r\n456\r\n"
[tester::#YG4] [propagation] master: > SET baz 789
[tester::#YG4] [propagation] master: Sent bytes: "*3\r\n$3\r\nSET\r\n$3\r\nbaz\r\n$3\r\n789\r\n"
[tester::#YG4] [test] Getting key foo
[tester::#YG4] [test] client: $ redis-cli GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program]
[your_program] 17:32:17.191 [debug] Received PSYNC response: <<43, 70, 85, 76, 76, 82, 69, 83, 89, 78, 67, 32, 55, 53, 99, 100, 55, 98, 99, 49, 48, 99, 52, 57, 48, 52, 55, 101, 48, 100, 49, 54, 51, 54, 54, 48, 102, 51, 98, 57, 48, 54, 50, 53, 98, 49, 97, 102, 51, 49, ...>>
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program] FORMATTER ERROR: bad return value
[your_program]
[your_program] 17:32:17.196 [info] Starting to receive data from socket
[your_program]
[your_program] 17:32:17.196 [debug] Receiving data. Buffer size: 0, Expected length: 0
[your_program] Executing GET command for key: foo
[tester::#YG4] [test] client: Received bytes: "$-1\r\n"
[tester::#YG4] [test] client: Received RESP null bulk string: "$-1\r\n"
[your_program]
[your_program] 17:32:17.196 [debug] ** (RuntimeError) bad return value from Logger formatter Logger.Formatter, got [<<250, 9, 114, 101, 100, 105, 115, 45, 118, 101, 114, 5, 55, 46, 50, 46, 48, 250, 10, 114, 101, 100, 105, 115, 45, 98, 105, 116, 115, 192, 64, 250, 5, 99, 116, 105, 109, 101, 194, 109, 8, 188, 101, 250, 8, 117, 115, 101, 100, ...>>, "\n"] after "\n17:32:17.195 [debug] PSYNC successful. Replication ID: 75cd7bc10c49047e0d163660f3b90625b1af31dc, Offset: 0\r\n$88\r\nREDIS0011"
[your_program] (kernel 9.2.4) logger_h_common.erl:430: :logger_h_common.string_to_binary/1
[your_program] (kernel 9.2.4) logger_h_common.erl:396: :logger_h_common.do_log_to_binary/2
[your_program] (kernel 9.2.4) logger_h_common.erl:177: :logger_h_common.log/2
[your_program] (kernel 9.2.4) logger_backend.erl:51: :logger_backend.call_handlers/3
[your_program] (redis 1.0.0) lib/server.ex:172: Server.receive_psync_response/1
[your_program] (redis 1.0.0) lib/server.ex:100: Server.perform_handshake/2
[your_program] (redis 1.0.0) lib/server.ex:59: Server.connect_to_master/2
[your_program]
[tester::#YG4] [test] Retrying... (1/5 attempts)
[tester::#YG4] [test] client: > GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program] Executing GET command for key: foo
[tester::#YG4] [test] client: Received bytes: "$-1\r\n"
[tester::#YG4] [test] client: Received RESP null bulk string: "$-1\r\n"
[tester::#YG4] [test] Retrying... (2/5 attempts)
[tester::#YG4] [test] client: > GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program] Executing GET command for key: foo
[tester::#YG4] [test] client: Received bytes: "$-1\r\n"
[tester::#YG4] [test] client: Received RESP null bulk string: "$-1\r\n"
[tester::#YG4] [test] Retrying... (3/5 attempts)
[tester::#YG4] [test] client: > GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program] Executing GET command for key: foo
[tester::#YG4] [test] client: Received bytes: "$-1\r\n"
[tester::#YG4] [test] client: Received RESP null bulk string: "$-1\r\n"
[tester::#YG4] [test] Retrying... (4/5 attempts)
[tester::#YG4] [test] client: > GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program] Executing GET command for key: foo
[tester::#YG4] [test] client: Received bytes: "$-1\r\n"
[tester::#YG4] [test] client: Received RESP null bulk string: "$-1\r\n"
[tester::#YG4] [test] Retrying... (5/5 attempts)
[tester::#YG4] [test] client: > GET foo
[tester::#YG4] [test] client: Sent bytes: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Received command: "*2\r\n$3\r\nGET\r\n$3\r\nfoo\r\n"
[your_program] Parsed data: ["GET", "foo"]
[your_program] Executing GET command for key: foo
[tester::#YG4] [test] client: Received bytes: "$-1\r\n"
[tester::#YG4] [test] client: Received RESP null bulk string: "$-1\r\n"
[tester::#YG4] Expected simple string or bulk string, got NIL
[tester::#YG4] Test failed
[tester::#YG4] Terminating program
[your_program]
[your_program] 17:32:20.266 [notice] SIGTERM received - shutting down
[your_program]
[your_program] Socket state after handshake: [recv_oct: 259, recv_cnt: 4, recv_max: 242, recv_avg: 64, recv_dvi: 43, send_oct: 133, send_cnt: 4, send_max: 49, send_avg: 33, send_pend: 0]
[your_program]
[your_program] 17:32:20.266 [error] Error receiving data: :closed
[your_program]
[your_program] 17:32:20.266 [error] Failed to receive RDB file: :closed
[your_program]
[your_program] 17:32:20.268 [info] Handshake completed successfully
[tester::#YG4] Program terminated successfully