Attempting to solve random unit test failure