diff --git a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java index cc417c15cc66..818e59c3a2c3 100644 --- a/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java +++ b/platform/testFramework/src/com/intellij/testFramework/fixtures/impl/LightTempDirTestFixtureImpl.java @@ -134,7 +134,13 @@ public class LightTempDirTestFixtureImpl extends BaseFixture implements TempDirT } public VirtualFile getFile(@NonNls String path) { - return getSourceRoot().findFileByRelativePath(path); + final VirtualFile sourceRoot = getSourceRoot(); + final VirtualFile result = sourceRoot.findFileByRelativePath(path); + if (result == null) { + sourceRoot.refresh(false, true); + return sourceRoot.findFileByRelativePath(path); + } + return result; } @NotNull