tests: reduce the use if PIDs in examples and tests