testing_faq.md: indexing changes in 242

This commit is contained in:
Yann Cébron 2024-06-17 11:39:44 +02:00
parent 6c67124f0d
commit cdbedc05cc
2 changed files with 12 additions and 1 deletions

View File

@ -16,7 +16,10 @@ Dumb-aware intentions and quick-fixes
: Mark implementations as enabled during indexing, see [](indexing_and_psi_stubs.md#DumbAwareAPI).
Testing: `ProjectActivity`
: Executed asynchronously now during tests, see FAQ entry [](testing_faq.md#how-to-handle-projectactivity).
: Executed asynchronously now during tests, see [](testing_faq.md#how-to-handle-projectactivity).
Testing: indexes
: Indexes are now built asynchronously during tests, see [](testing_faq.md#how-to-handle-indexing).
## 2024.1

View File

@ -17,6 +17,7 @@ This page lists a number of common questions/issues and techniques useful for te
- [`PsiTestUtil`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/PsiTestUtil.java)
- [`VfsTestUtil`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/VfsTestUtil.java)
- [`IoTestUtil`](%gh-ic%/platform/testFramework/src/com/intellij/openapi/util/io/IoTestUtil.java)
- [`IndexingTestUtil`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/IndexingTestUtil.kt)
- [`LeakHunter`](%gh-ic%/platform/testFramework/common/src/LeakHunter.java)
### UI
@ -229,4 +230,11 @@ PsiTestUtil.addLibrary(model,
If tests depend on some job done in `ProjectActivity` (e.g., automatic project re-import), implement a dedicated [event/listener](messaging_infrastructure.md) and wait for it explicitly.
As a workaround, use [`StartupActivityTestUtil.waitForProjectActivitiesToComplete()`](%gh-ic-master%/platform/testFramework/src/com/intellij/testFramework/StartupActivityTestUtil.kt).
### How to handle indexing?
<primary-label ref="2024.2"/>
Indexing is now run asynchronously in a background thread.
Use [`IndexingTestUtil.waitUntilIndexesAreReady()/suspendUntilIndexesAreReady()`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/IndexingTestUtil.kt)
to wait for fully populated indexes.
<include from="snippets.md" element-id="missingContent"/>