I’m stuck on Stage #PV1).
I passed the previous stages, and now when i run my tests with git or codecrafers test
it looks like it tests both the current #PV1 stage and the previous #NC5.
My tests fail because the two stages both require a different reponse (#NC5 only needs message_size, correlation_id and error_code=35, while #PV1 wants a complete ApiVersions Response)
Here are my logs:
[tester::#PV1] Running tests for Stage #PV1 (Handle APIVersions requests)
[tester::#PV1] $ ./your_program.sh /tmp/server.properties
[tester::#PV1] Connecting to broker at: localhost:9092
[your_program] 2025-05-29T11:05:26.396104Z INFO codecrafters_kafka: Listening on port 9092
[tester::#PV1] Connection to broker at localhost:9092 successful
[tester::#PV1] Sending "ApiVersions" (version: 4) request (Correlation id: 1036546890)
[tester::#PV1] Hexdump of sent "ApiVersions" request:
[tester::#PV1] Idx | Hex | ASCII
[tester::#PV1] -----+-------------------------------------------------+-----------------
[tester::#PV1] 0000 | 00 00 00 23 00 12 00 04 3d c8 73 4a 00 09 6b 61 | ...#....=.sJ..ka
[tester::#PV1] 0010 | 66 6b 61 2d 63 6c 69 00 0a 6b 61 66 6b 61 2d 63 | fka-cli..kafka-c
[tester::#PV1] 0020 | 6c 69 04 30 2e 31 00 | li.0.1.
[tester::#PV1]
[your_program] 2025-05-29T11:05:27.394926Z INFO codecrafters_kafka: Socket connected 127.0.0.1:50836
[tester::#PV1] Hexdump of received "ApiVersions" response:
[tester::#PV1] Idx | Hex | ASCII
[tester::#PV1] -----+-------------------------------------------------+-----------------
[tester::#PV1] 0000 | 00 00 00 13 3d c8 73 4a 00 00 02 00 12 00 04 00 | ....=.sJ........
[tester::#PV1] 0010 | 04 00 00 00 00 00 00 | .......
[tester::#PV1]
[tester::#PV1] [Decoder] - .ResponseHeader
[tester::#PV1] [Decoder] - .correlation_id (1036546890)
[tester::#PV1] [Decoder] - .ResponseBody
[tester::#PV1] [Decoder] - .error_code (0)
[tester::#PV1] [Decoder] - .num_api_keys (1)
[tester::#PV1] [Decoder] - .ApiKeys[0]
[tester::#PV1] [Decoder] - .api_key (18)
[tester::#PV1] [Decoder] - .min_version (4)
[tester::#PV1] [Decoder] - .max_version (4)
[tester::#PV1] [Decoder] - .TAG_BUFFER
[tester::#PV1] [Decoder] - .throttle_time_ms (0)
[tester::#PV1] [Decoder] - .TAG_BUFFER
[tester::#PV1] ✓ Correlation ID: 1036546890
[tester::#PV1] ✓ Error code: 0 (NO_ERROR)
[tester::#PV1] ✓ API keys array is non-empty
[tester::#PV1] ✓ API version 4 is supported for API_VERSIONS
[tester::#PV1] Test passed.
[tester::#PV1] Terminating program
[your_program] 2025-05-29T11:05:27.395334Z INFO kafka::message::request: Parsed Request! Bytes remainging in buffer: 0
[tester::#PV1] Program terminated successfully
[tester::#NC5] Running tests for Stage #NC5 (Parse API Version)
[tester::#NC5] $ ./your_program.sh /tmp/server.properties
[tester::#NC5] Connecting to broker at: localhost:9092
[your_program] 2025-05-29T11:05:27.400047Z INFO codecrafters_kafka: Listening on port 9092
[tester::#NC5] Connection to broker at localhost:9092 successful
[tester::#NC5] Sending "ApiVersions" (version: 5283) request (Correlation id: 785056475)
[tester::#NC5] Hexdump of sent "ApiVersions" request:
[tester::#NC5] Idx | Hex | ASCII
[tester::#NC5] -----+-------------------------------------------------+-----------------
[tester::#NC5] 0000 | 00 00 00 23 00 12 14 a3 2e cb 02 db 00 09 6b 61 | ...#..........ka
[tester::#NC5] 0010 | 66 6b 61 2d 63 6c 69 00 0a 6b 61 66 6b 61 2d 63 | fka-cli..kafka-c
[tester::#NC5] 0020 | 6c 69 04 30 2e 31 00 | li.0.1.
[tester::#NC5]
[your_program] 2025-05-29T11:05:28.399024Z INFO codecrafters_kafka: Socket connected 127.0.0.1:50854
[your_program] 2025-05-29T11:05:28.399342Z INFO kafka::message::request: Parsed Request! Bytes remainging in buffer: 0
[tester::#NC5] Hexdump of received "ApiVersions" response:
[tester::#NC5] Idx | Hex | ASCII
[tester::#NC5] -----+-------------------------------------------------+-----------------
[tester::#NC5] 0000 | 00 00 00 13 2e cb 02 db 00 00 02 00 12 00 04 00 | ................
[tester::#NC5] 0010 | 04 00 00 00 00 00 00 | .......
[tester::#NC5]
[tester::#NC5] [Decoder] - .Response
[tester::#NC5] [Decoder] - .message_length (19)
[tester::#NC5] [Decoder] - .ResponseHeader
[tester::#NC5] [Decoder] - .correlation_id (785056475)
[tester::#NC5] [Decoder] - .error_code (0)
[tester::#NC5] ✓ Correlation ID: 785056475
[tester::#NC5] Expected Error code to be 35, got 0
[tester::#NC5] Test failed
[tester::#NC5] Terminating program
[tester::#NC5] Program terminated successfully
Im not pasting in my code because as you can see the newer stage test (#PV1) has already passed, and before that i passed the previous test too, and I assume this is error is not my fault