Merge "Refactor test code to prepare for multi process tests"