Possible tester error on stage vt6

Hello,
While trying to run tests on my latest commit, I noticed the tester output was a bit strange. It complains about failing and somehow reads two additional characters, but after repeated analysis of the output and trying to see how the topic name was stored, it seems like it’s not on my end. Just to be sure, I wanted to ask here first.

Here is the tester output:

remote: [tester::#VT6] Running tests for Stage #VT6 (Listing Partitions - List for an unknown topic)
remote: [tester::#VT6] $ ./your_program.sh /tmp/server.properties
remote: [tester::#VT6] Connecting to broker at: localhost:9092
remote: [your_program] Waiting for a client to connect...        
remote: [your_program] Logs from your program will appear here!        
remote: [tester::#VT6] Connection to broker at localhost:9092 successful
remote: [your_program] Client connected at file descriptor: 4        
remote: [tester::#VT6] Sending "DescribeTopicPartitions" (version: 0) request (Correlation id: 1533124501)
remote: [tester::#VT6] Hexdump of sent "DescribeTopicPartitions" request: 
remote: [tester::#VT6] Idx  | Hex                                             | ASCII
remote: [tester::#VT6] -----+-------------------------------------------------+-----------------
remote: [tester::#VT6] 0000 | 00 00 00 31 00 4b 00 00 5b 61 9f 95 00 0c 6b 61 | ...1.K..[a....ka
remote: [tester::#VT6] 0010 | 66 6b 61 2d 74 65 73 74 65 72 00 02 12 75 6e 6b | fka-tester...unk
remote: [tester::#VT6] 0020 | 6e 6f 77 6e 2d 74 6f 70 69 63 2d 73 61 7a 00 00 | nown-topic-saz..
remote: [tester::#VT6] 0030 | 00 00 01 ff 00                                  | .....
remote: [tester::#VT6] 
remote: [your_program] Request API Key: 75        
remote: [tester::#VT6] Hexdump of received "DescribeTopicPartitions" response: 
remote: [tester::#VT6] Idx  | Hex                                             | ASCII
remote: [tester::#VT6] -----+-------------------------------------------------+-----------------
remote: [tester::#VT6] 0000 | 00 00 00 38 5b 61 9f 95 00 00 00 00 00 02 00 03 | ...8[a..........
remote: [tester::#VT6] 0010 | 13 75 6e 6b 6e 6f 77 6e 2d 74 6f 70 69 63 2d 73 | .unknown-topic-s
remote: [tester::#VT6] 0020 | 61 7a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 | az..............
remote: [tester::#VT6] 0030 | 00 00 00 00 01 00 00 00 00 00 ff 00             | ............
remote: [tester::#VT6] 
remote: [tester::#VT6] [Decoder] - .ResponseHeader
remote: [tester::#VT6] [Decoder]   - .correlation_id (1533124501)
remote: [tester::#VT6] [Decoder]   - .TAG_BUFFER
remote: [your_program] Request API Version: 0        
remote: [tester::#VT6] [Decoder] - .ResponseBody
remote: [tester::#VT6] [Decoder]   - .throttle_time_ms (0)
remote: [tester::#VT6] [Decoder]   - .topic.length (1)
remote: [tester::#VT6] [Decoder]   - .Topics[0]
remote: [tester::#VT6] [Decoder]     - .error_code (3)
remote: [tester::#VT6] [Decoder]     - .name (unknown-topic-sazester::#VT6] [Decoder]     - .topic_id (00000000-0000-0000-0000-000000000000)
remote: [tester::#VT6] [Decoder]     - .is_internal (false)
remote: [tester::#VT6] [Decoder]     - .num_partitions (0)
remote: [tester::#VT6] [Decoder]     - .topic_authorized_operations (0)
remote: [tester::#VT6] [Decoder]     - .TAG_BUFFER
remote: [tester::#VT6] [Decoder]   - .next_cursor (null)
remote: [tester::#VT6] [Decoder]   - .TAG_BUFFER
remote: [tester::#VT6] ✓ Correlation ID: 1533124501
remote: [tester::#VT6] ✓ Throttle Time: 0
remote: [tester::#VT6]   ✓ TopicResponse[0] Error code: 3
remote: [tester::#VT6] Expected TopicResponse[0] Topic Name to be unknown-topic-saz, got unknown-topic-sazam
remote: [your_program] Request Correlation ID: 1533124501        
remote: [your_program] Appending 2bytes to response        
remote: [your_program] Appending 1 byte to response        
remote: [your_program] Topic name: unknown-topic-saz character: u        
remote: [your_program] Added character: n        
remote: [your_program] Added character: k        
remote: [your_program] Added character: n        
remote: [your_program] Added character: o        
remote: [your_program] Added character: w        
remote: [your_program] Added character: n        
remote: [your_program] Added character: -        
remote: [your_program] Added character: t        
remote: [your_program] Added character: o        
remote: [your_program] Added character: p        
remote: [your_program] Added character: i        
remote: [your_program] Added character: c        
remote: [your_program] Added character: -        
remote: [your_program] Added character: s        
remote: [your_program] Added character: a        
remote: [your_program] Added character: z        
remote: [your_program] Added character: mProgram terminated successfully

If necessary, I am ready to add snippets later. Do you have access to my repo?

Hey @fortwoone, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

Here you go: GitHub - fortwoone/cpp_kafka: CPP light implementation of Kafka for Codecrafters' "Build your own Kafka" challenge

Is it visible on your end?

1 Like

@fortwoone The extra empty trailing character looks like an off-by-one error:

The string_name_length cannot be used directly:

Let me know if you’d like further clarification!

Ooh, I think I see. Thanks for the clarification! Will come back if I encounter any further weird errors

1 Like

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