Fix running tests for autoloaded classes(cherry picked from commit 689f91f6bc50bb3c1be4631fb4214690d0b598de)