REVIEW-3379: Moved creation of test file to where it's needed.