Tests: Avoid looping on app PIDs during cleanup
authorKienan Stewart <kstewart@efficios.com>
Thu, 8 Jun 2023 15:05:17 +0000 (11:05 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 28 Feb 2024 15:38:52 +0000 (10:38 -0500)
commitc1896e2d809e0d32d2d9b8a840755de6d5d70eaf
treee078295dbd82192c83e7e5c05522cd835b349af9
parentf7169e41979bb8a57ecf2ff3683fefa74e05179b
Tests: Avoid looping on app PIDs during cleanup

When the list of app PIDs becomes long, eg. in the case for
`tests/regression/ust/nprocesses/test_nprocesses`, then performing the
following type of loop can be quite slow, especially if the apps have
some teardown time internally:

```
for p in ${APP_PIDS} ; do
  kill ${p}
  wait ${p}
done
```

Both `kill` and `wait` take a list of PIDs, so the cleanup is easily
factorable to

```
kill ${APP_PIDS}
wait ${APP_PIDS}
```

In the case of `test_nprocesses`, the test run time drops from ~25s to
~4s. The difference is less important in tests with fewer apps.

Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9619939b4f1201a99f9666dee3e19551a67c9fb6
tests/regression/tools/snapshots/test_ust_streaming
tests/regression/tools/snapshots/ust_test
tests/regression/ust/nprocesses/test_nprocesses
tests/regression/ust/periodical-metadata-flush/test_periodical_metadata_flush
tests/stress/test_multi_sessions_per_uid_10app
tests/stress/test_multi_sessions_per_uid_5app_streaming
tests/stress/test_multi_sessions_per_uid_5app_streaming_kill_relayd
This page took 0.025454 seconds and 4 git commands to generate.