I’m trying redis challenge with C++ and love it so far. Suddenly, around 10 stage, I’ve started to see in testrunner logs that build fails. I’ve tried to add -j2 to make and made it through couple of stages, but totally stuck for now.
I’m actively using separated modules, as it good for any project. As I see, with 10 modules (here, translation units for purists) build takes some time, but test runner tries to connect to server too early, finds that connection is refused and terminates build. Thus failing testing finally.
I think it may be real to bypass problem by squishing all in single module. But I feel extremely uncomfortable around testing system that forces me to do this. Also problem anyway will be present with more complex code, I think.
Thanks in advance, maybe I’ve oversaw something and somewhere exists simple solution for my problem.
Here’s sample log with uncommented cmake and make logs:
remote: [replication-4] Running tests for Replication > Stage #4: Initial Replication ID and Offset
remote: [replication-4] $ ./spawn_redis_server.sh
remote: [your_program] -- The C compiler identification is GNU 12.2.0
remote: [your_program] -- The CXX compiler identification is GNU 12.2.0
remote: [your_program] -- Detecting C compiler ABI info
remote: [your_program] -- Detecting C compiler ABI info - done
remote: [your_program] -- Check for working C compiler: /usr/bin/cc - skipped
remote: [your_program] -- Detecting C compile features
remote: [your_program] -- Detecting C compile features - done
remote: [your_program] -- Detecting CXX compiler ABI info
remote: [your_program] -- Detecting CXX compiler ABI info - done
remote: [your_program] -- Check for working CXX compiler: /usr/local/bin/c++ - skipped
remote: [your_program] -- Detecting CXX compile features
remote: [your_program] -- Detecting CXX compile features - done
remote: [your_program] -- Configuring done
remote: [your_program] -- Generating done
remote: [your_program] -- Build files have been written to: /app
remote: [your_program] Scanning dependencies of target server
remote: [your_program] [ 9%] Building CXX object CMakeFiles/server.dir/src/client.cpp.o
remote: [your_program] [ 18%] Building CXX object CMakeFiles/server.dir/src/command.cpp.o
remote: [your_program] [ 27%] Building CXX object CMakeFiles/server.dir/src/main.cpp.o
remote: [your_program] [ 36%] Building CXX object CMakeFiles/server.dir/src/message.cpp.o
remote: [replication-4] dial tcp 127.0.0.1:6379: connect: connection refused
remote: [replication-4] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
remote: [your_program] make[2]: *** [CMakeFiles/server.dir/build.make:121: CMakeFiles/server.dir/src/message.cpp.o] Terminated
remote: [your_program] make[1]: *** [CMakeFiles/Makefile2:95: CMakeFiles/server.dir/all] Terminated
remote: [your_program] make: *** [Makefile:103: all] Terminated