I am trying to run my test cases which are nearly 40k with below scripts.
Just showing some part of script -
#!/bin/bash
# RUN script
echo "please run with: nice nohup ./run_script"
# working directory where script is stored
WORKING_DIR=$(pwd)
# temp directory to build and run the cmake ctest
BUILD_DIR=${BUILD_DIR:-/localtemp/build}
# clean and make build directory
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR
mkdir -p $BUILD_DIR/../result
cmake -G Ninja
ninja test
Note: I am using parallel threading with 6 cores to run my test cases .
In first attempt all are passing which is true as I fixed all the bugs in my test cases.
But some time If I want to re-run same script freshly, then I am getting the error in running some test cases out of 40k. But If I run that failing test cases separately(one by one) then they are passing perfectly.
So I assumed that rm -rf is taking some time to delete that old binary and symbols of all cases (40 GB files). so I need to wait for complete deletion and then run my script once again . So should I add some delay after rm -rf command in my script .
I read somewhere that rm -rf will return the status once it finishes the work .Then only next command executes. But my scnerio looks like showing that rm -rf is running in background.
Means I should not start new run immediately when I stopped the earlier run . I need to give some time to delete the old output from earlier run using rm -rf command in script (delay introduction) and run my below ninja command after that. Is that true?