I want to do stress testing of my software. I have multiple testcases with me with different runtime.Currently, I'm running stress utility with required options and run testcase in another terminal. Once that testcase gets over, I kill stress process with ctr+C. Now, I want to create a script which will run the stress utility and then run testcase and should be able to kill stress process after my testcase gets over.I have a workaround as of now with stress i.e. --timeout option. So I'm running as follows:stress -c 16 --timeout 3600 ./runme //Testcase scriptAfter an hour, stress utility gets finished. But there is following issue with the above mentioned workaround i.e. ./runme can take 1 min to 2-3 hours of time. So I can't put timeout value beforehand.Please suggest a way to deal with this.
How to keep process (stress) running till I have testcase running
linux;process;performance
Run your stresser in the background and note it's pid which will be used to kill it later on. And now start your testcases in the foreground. After the testsuites finish, you go ahead n kill the stresser now:stress -c 16 & #<--- note no timeoutoption given and assuming now it runs foreverpid_stress=$!./rune //Testcases scriptkill -9 $pid_stress