Skip to content

Commit 0c7ce1f

Browse files
committed
fix(test): fix FileFilters exclude test race condition in Firefox
The awaitsFor loop only checked that CSS results were absent but did not wait for HTML results to be populated. In Firefox on CI the search can remove CSS matches before finishing HTML indexing, causing the subsequent expect to see undefined. Add the positive HTML check to both awaitsFor conditions, matching the pattern already used in the filter-switching test.
1 parent 6804af6 commit 0c7ce1f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

test/spec/FileFilters-integ-test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@ define(function (require, exports, module) {
214214
await openSearchBar();
215215
await awaitsFor(async ()=>{
216216
await executeCleanSearch("{1}");
217-
return !FindInFiles.searchModel.results[testPath + "/test1.css"];
217+
return !FindInFiles.searchModel.results[testPath + "/test1.css"] &&
218+
!!FindInFiles.searchModel.results[testPath + "/test1.html"];
218219
// retry as instant/deferred searches can race with the explicit search
219220
}, "Search to exclude css results", 7000, 300);
220221
// *.css should have been excluded this time
@@ -329,7 +330,8 @@ define(function (require, exports, module) {
329330
_setExcludeFiles("*.css");
330331
await awaitsFor(async ()=>{
331332
await executeCleanSearch("{1}");
332-
return !FindInFiles.searchModel.results[testPath + "/test1.css"];
333+
return !FindInFiles.searchModel.results[testPath + "/test1.css"] &&
334+
!!FindInFiles.searchModel.results[testPath + "/test1.html"];
333335
// retry as instant/deferred searches can race with the explicit search
334336
}, "Search to exclude css results", 7000, 300);
335337
expect(FindInFiles.searchModel.results[testPath + "/test1.css"]).toBeFalsy();

0 commit comments

Comments
 (0)