Codecrafters cli not creating files under /tmp directory

Hello!

I am attempting to run test case AP#6 under the http server project. I noticed that the stage “[tester::#AP6] Creating file mango_grape_pear_raspberry in /tmp/data/codecrafters.io/http-server-tester/” doesn’t actually do anything in my system. I even tried to run the codecrafters CLI as root to rule-out permission issues.

[tester::#AP6] Running tests for Stage #AP6 (Return a file)
[tester::#AP6] Running program
[tester::#AP6] $ ./your_program.sh --directory /tmp/data/codecrafters.io/http-server-tester/
[tester::#AP6] Testing existing file
[tester::#AP6] Creating file mango_grape_pear_raspberry in /tmp/data/codecrafters.io/http-server-tester/
[tester::#AP6] File Content: "orange mango pear blueberry orange grape apple pineapple"
[your_program] Waiting for a client to connect...
[tester::#AP6] Connected to localhost port 4221
[tester::#AP6] $ curl -v http://localhost:4221/files/mango_grape_pear_raspberry
[tester::#AP6] > GET /files/mango_grape_pear_raspberry HTTP/1.1
[tester::#AP6] > Host: localhost:4221
[tester::#AP6] >
[tester::#AP6] Sent bytes: "GET /files/mango_grape_pear_raspberry HTTP/1.1\r\nHost: localhost:4221\r\n\r\n"
[tester::#AP6] Received bytes: "HTTP/1.1 404 Not Found\r\n\r\n"
[tester::#AP6] < HTTP/1.1 404 Not Found
[tester::#AP6] <
[tester::#AP6] Expected status code 200, got 404
[tester::#AP6] Test failed
[tester::#AP6] Terminating program
[tester::#AP6] Program terminated successfully

Worth mentioning that I created the folders under /tmp/data/… seen below. The executable is placed in the /tmp folder without any issues.

[null@null http-server-tester]$ ls
[null@null http-server-tester]$ pwd
/tmp/data/codecrafters.io/http-server-tester
[null@null http-server-tester]$

Has anyone encountered this issue before?

Hi @tesaddict, this is expected behavior. The temporary files in the logs were created on our server.

Feel free to create temporary files manually for your local tests if needed.

Thank you for the quick reply @andy1li . I didn’t realize these test cases run on the codecrafters server. After closer inspection; I found a bug in my implementation and corrected it. The test case is now passing.

1 Like

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