Hi,
Thank you for the verification. I have written some code in C for testing that creates a fork which runs a function that sleeps for a time (less than the command I actually want to run, but long enough for the parent thread to end). It can be found here: https://github.com/MichaelPed/test-scripts-lava
I have tried numerous ways to get the PID of the child process spawned by this code, and wait until it does running. This can be said to be two areas: Direct wait methods, and polling. Neither have worked so far, with them either not running at all, returning an error (process is not a child...) or they continue to "wait" until well after the process has ended (sometimes even not ending at all, requiring I cancel the job or let it timeout).
This is strange as they all work fine when run manually. For a better idea of what the job is actually doing for testing (so I will skip deploy and boot explanation): my yaml files run steps pretty much only runs the command "lava-test-case test-script --shell ./test.sh". Any another commands run before this are just to make sure that that script can be run (e.g. cd and chmod).
This test.sh has the following code in it: ./test ; while kill -0 $(pgrep test) ; do sleep 0.1; done
That while loop is one of several variations I have tried, I've also tried starting the test code as a background process (so using & after call). I and others are quite stumped by this, since it works fine waiting for the background process spawned to end when run manually, but in LAVA it refuses to work.
I hope any of this helps you to help me, thank you for the help so far.
Best regards, Michael