When running the tests make sure to write the test files into the temp directory. This fixes issue 19112