Skip to content

Commit 55847b6

Browse files
committed
Fix race
1 parent d2e6291 commit 55847b6

File tree

112 files changed

+167
-177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+167
-177
lines changed

internal/fourslash/_scripts/failingTests.txt

Lines changed: 52 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
TestCompletionForStringLiteral
2+
TestCompletionForStringLiteralNonrelativeImport7
3+
TestCompletionForStringLiteralNonrelativeImportTypings2
24
TestCompletionForStringLiteralNonrelativeImportTypings3
3-
TestCompletionForStringLiteralRelativeImport4
45
TestCompletionForStringLiteralRelativeImport6
5-
TestCompletionForStringLiteralRelativeImportAllowJSTrue
66
TestCompletionForStringLiteralWithDynamicImport
77
TestCompletionForStringLiteral_details
88
TestCompletionForStringLiteral_quotePreference
@@ -24,39 +24,25 @@ TestCompletionImportModuleSpecifierEndingTsxPreserve
2424
TestCompletionImportModuleSpecifierEndingTsxReact
2525
TestCompletionImportModuleSpecifierEndingUnsupportedExtension
2626
TestCompletionInFunctionLikeBody_includesPrimitiveTypes
27-
TestCompletionInJsDoc
2827
TestCompletionInNamedImportLocation
2928
TestCompletionInUncheckedJSFile
30-
TestIndexerReturnTypes1
31-
TestIndirectClassInstantiation
32-
TestJsDocFunctionSignatures11
33-
TestJsDocFunctionSignatures13
34-
TestJsDocFunctionSignatures7
35-
TestJsDocFunctionSignatures8
36-
TestJsDocPropertyDescription4
37-
TestJsDocPropertyDescription5
38-
TestJsDocPropertyDescription6
39-
TestJsDocPropertyDescription7
40-
TestJsDocPropertyDescription8
41-
TestJsDocPropertyDescription9
42-
TestJsDocTagsWithHyphen
43-
TestJsQuickInfoGenerallyAcceptableSize
44-
TestJsRequireQuickInfo
45-
TestJsdocCallbackTag
46-
TestJsdocLink2
47-
TestJsdocLink3
48-
TestJsdocLink6
49-
TestJsdocLink_findAllReferences1
50-
TestJsdocTypedefTag
51-
TestJsdocTypedefTag2
52-
TestJsdocTypedefTagNamespace
53-
TestLocalFunction
54-
TestMemberListInReopenedEnum
55-
TestMemberListInWithBlock
29+
TestCompletionListBuilderLocations_VariableDeclarations
30+
TestCompletionListForDerivedType1
31+
TestOverloadQuickInfo
32+
TestParameterWithDestructuring
33+
TestParameterWithNestedDestructuring
34+
TestPathCompletionsAllowModuleAugmentationExtensions
35+
TestPathCompletionsAllowTsExtensions
36+
TestPathCompletionsPackageJsonExportsBundlerNoNodeCondition
37+
TestPathCompletionsPackageJsonExportsCustomConditions
5638
TestPathCompletionsPackageJsonExportsWildcard1
39+
TestPathCompletionsPackageJsonExportsWildcard10
5740
TestPathCompletionsPackageJsonExportsWildcard11
5841
TestPathCompletionsPackageJsonExportsWildcard12
5942
TestPathCompletionsPackageJsonExportsWildcard2
43+
TestPathCompletionsPackageJsonExportsWildcard3
44+
TestPathCompletionsPackageJsonExportsWildcard4
45+
TestPathCompletionsPackageJsonExportsWildcard5
6046
TestPathCompletionsPackageJsonExportsWildcard6
6147
TestPathCompletionsPackageJsonExportsWildcard7
6248
TestPathCompletionsPackageJsonExportsWildcard8
@@ -87,15 +73,15 @@ TestPathCompletionsPackageJsonImportsWildcard7
8773
TestPathCompletionsPackageJsonImportsWildcard8
8874
TestPathCompletionsPackageJsonImportsWildcard9
8975
TestPathCompletionsTypesVersionsLocal
90-
TestPathCompletionsTypesVersionsWildcard1
91-
TestPathCompletionsTypesVersionsWildcard2
9276
TestPathCompletionsTypesVersionsWildcard3
93-
TestPathCompletionsTypesVersionsWildcard4
94-
TestPathCompletionsTypesVersionsWildcard5
95-
TestPathCompletionsTypesVersionsWildcard6
9677
TestProtoVarVisibleWithOuterScopeUnderscoreProto
9778
TestQuickInfoAlias
9879
TestQuickInfoAssertionNodeNotReusedWhenTypeNotEquivalent1
80+
TestQuickInfoBindingPatternInJsdocNoCrash1
81+
TestQuickInfoClassKeyword
82+
TestQuickInfoContextualTyping
83+
TestQuickInfoContextuallyTypedSignatureOptionalParameterFromIntersection1
84+
TestQuickInfoDisplayPartsIife
9985
TestQuickInfoElementAccessDeclaration
10086
TestQuickInfoForConstTypeReference
10187
TestQuickInfoForContextuallyTypedArrowFunctionInSuperCall
@@ -116,9 +102,33 @@ TestQuickInfoForTypeofParameter
116102
TestQuickInfoForUMDModuleAlias
117103
TestQuickInfoFromContextualType
118104
TestQuickInfoFunctionKeyword
119-
TestQuickInfoJsPropertyAssignedAfterMethodDeclaration
120-
TestQuickInfoJsdocTypedefMissingType
121-
TestQuickInfoMappedSpreadTypes
105+
TestQuickInfoGenerics
106+
TestQuickInfoGetterSetter
107+
TestQuickInfoImportNonunicodePath
108+
TestQuickInfoInInvalidIndexSignature
109+
TestQuickInfoInJsdocInTsFile1
110+
TestQuickInfoInOptionalChain
111+
TestQuickInfoInWithBlock
112+
TestQuickInfoJSDocBackticks
113+
TestQuickInfoJSDocFunctionNew
114+
TestQuickInfoJSDocFunctionThis
115+
TestQuickInfoJSExport
116+
TestQuickInfoJsDocGetterSetterNoCrash1
117+
TestQuickInfoJsDocNonDiscriminatedUnionSharedProp
118+
TestQuickInfoOnCatchVariable
119+
TestQuickInfoOnClosingJsx
120+
TestQuickInfoOnElementAccessInWriteLocation1
121+
TestQuickInfoOnElementAccessInWriteLocation2
122+
TestQuickInfoOnElementAccessInWriteLocation3
123+
TestQuickInfoOnElementAccessInWriteLocation4
124+
TestQuickInfoOnElementAccessInWriteLocation5
125+
TestQuickInfoOnErrorTypes1
126+
TestQuickInfoOnFunctionPropertyReturnedFromGenericFunction1
127+
TestQuickInfoOnFunctionPropertyReturnedFromGenericFunction2
128+
TestQuickInfoOnFunctionPropertyReturnedFromGenericFunction3
129+
TestQuickInfoOnGenericWithConstraints1
130+
TestQuickInfoOnInternalAliases
131+
TestQuickInfoOnMethodOfImportEquals
122132
TestQuickInfoOnNarrowedType
123133
TestQuickInfoOnNarrowedTypeInModule
124134
TestQuickInfoOnNewKeyword01
@@ -131,9 +141,12 @@ TestQuickInfoOnPropertyAccessInWriteLocation2
131141
TestQuickInfoOnPropertyAccessInWriteLocation3
132142
TestQuickInfoOnPropertyAccessInWriteLocation4
133143
TestQuickInfoOnPropertyAccessInWriteLocation5
144+
TestQuickInfoOnThis
134145
TestQuickInfoOnThis2
135146
TestQuickInfoOnThis3
136147
TestQuickInfoOnThis4
148+
TestQuickInfoOnUndefined
149+
TestQuickInfoOnVarInArrowExpression
137150
TestQuickInfoPrivateIdentifierInTypeReferenceNoCrash1
138151
TestQuickInfoPropertyTag
139152
TestQuickInfoSignatureOptionalParameterFromUnion1
@@ -158,7 +171,6 @@ TestQuickinfoForNamespaceMergeWithClassConstrainedToSelf
158171
TestQuickinfoForUnionProperty
159172
TestQuickinfoWrongComment
160173
TestRecursiveInternalModuleImport
161-
TestReferencesForExportedValues
162174
TestReferencesForStatementKeywords
163175
TestReferencesInComment
164176
TestReferencesInEmptyFile
@@ -167,26 +179,8 @@ TestRegexDetection
167179
TestReverseMappedTypeQuickInfo
168180
TestSelfReferencedExternalModule
169181
TestSignatureHelpInferenceJsDocImportTag
170-
TestSyntheticImportFromBabelGeneratedFile1
171-
TestSyntheticImportFromBabelGeneratedFile2
172-
TestThisBindingInLambda
173-
TestThisPredicateFunctionQuickInfo01
174-
TestThisPredicateFunctionQuickInfo02
175-
TestTripleSlashRefPathCompletionAbsolutePaths
176-
TestTripleSlashRefPathCompletionContext
177-
TestTripleSlashRefPathCompletionExtensionsAllowJSFalse
178-
TestTripleSlashRefPathCompletionExtensionsAllowJSTrue
179-
TestTripleSlashRefPathCompletionHiddenFile
180-
TestTripleSlashRefPathCompletionRootdirs
181-
TestTslibFindAllReferencesOnRuntimeImportWithPaths1
182-
TestTsxCompletion12
183-
TestTsxCompletion13
184-
TestTsxCompletion14
185-
TestTsxCompletion15
186-
TestTsxCompletionNonTagLessThan
182+
TestStringCompletionsImportOrExportSpecifier
183+
TestStringCompletionsVsEscaping
187184
TestTsxQuickInfo1
188-
TestTsxQuickInfo4
189-
TestTsxQuickInfo5
190-
TestTsxQuickInfo6
191185
TestTsxQuickInfo7
192186
TestTypeOperatorNodeBuilding

internal/fourslash/fourslash.go

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten
141141
// Just skip this for now.
142142
t.Skip("bundled files are not embedded")
143143
}
144-
ctx := t.Context()
145144

146145
fileName := getFileNameFromTest(t)
147146
testfs := make(map[string]string)
@@ -174,14 +173,15 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten
174173
ParsedFileCache: &parsedFileCache{},
175174
})
176175

177-
lspCtx, lspCancel := context.WithCancel(ctx)
176+
lspCtx, lspCancel := context.WithCancel(t.Context())
178177
lspErrChan := make(chan error, 1)
179178

180179
go func() {
181180
defer func() {
182181
outputWriter.Close()
183182
}()
184183
lspErrChan <- server.Run(lspCtx)
184+
t.Log("LSP server exited")
185185
}()
186186

187187
converters := ls.NewConverters(lsproto.PositionEncodingKindUTF8, func(fileName string) *ls.LineMap {
@@ -215,13 +215,9 @@ func NewFourslash(t *testing.T, capabilities *lsproto.ClientCapabilities, conten
215215
lspCancel()
216216
inputWriter.Close()
217217

218-
select {
219-
case <-ctx.Done():
220-
// do nothing
221-
case err := <-lspErrChan:
222-
if err != nil && lspCtx.Err() == nil {
223-
t.Errorf("LSP server exited with error: %v", err)
224-
}
218+
t.Log("Waiting for LSP server to exit")
219+
if err := <-lspErrChan; err != nil && lspCtx.Err() == nil {
220+
t.Errorf("LSP server exited with error: %v", err)
225221
}
226222
})
227223
return f

internal/fourslash/tests/gen/completionForStringLiteralNonrelativeImport7_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestCompletionForStringLiteralNonrelativeImport7(t *testing.T) {
1212
t.Parallel()
13-
13+
t.Skip()
1414
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1515
const content = `// @baseUrl: tests/cases/fourslash/modules
1616
// @Filename: tests/test0.ts

internal/fourslash/tests/gen/completionForStringLiteralNonrelativeImportTypings2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestCompletionForStringLiteralNonrelativeImportTypings2(t *testing.T) {
1212
t.Parallel()
13-
13+
t.Skip()
1414
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1515
const content = `// @typeRoots: my_typings,my_other_typings
1616
// @types: module-x,module-z

internal/fourslash/tests/gen/completionForStringLiteralRelativeImport4_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestCompletionForStringLiteralRelativeImport4(t *testing.T) {
1212
t.Parallel()
13-
t.Skip()
13+
1414
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1515
const content = `// @rootDirs: /sub/src1,/src2
1616
// @Filename: /src2/test0.ts

internal/fourslash/tests/gen/completionForStringLiteralRelativeImportAllowJSTrue_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestCompletionForStringLiteralRelativeImportAllowJSTrue(t *testing.T) {
1212
t.Parallel()
13-
t.Skip()
13+
1414
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1515
const content = `// @allowJs: true
1616
// @Filename: test0.ts

internal/fourslash/tests/gen/completionInJsDoc_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
func TestCompletionInJsDoc(t *testing.T) {
1414
t.Parallel()
15-
t.Skip()
15+
1616
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1717
const content = `// @allowJs: true
1818
// @Filename: Foo.js

internal/fourslash/tests/gen/completionListBuilderLocations_VariableDeclarations_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestCompletionListBuilderLocations_VariableDeclarations(t *testing.T) {
1212
t.Parallel()
13-
13+
t.Skip()
1414
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1515
const content = `var x = a/*var1*/
1616
var x = (b/*var2*/

internal/fourslash/tests/gen/completionListForDerivedType1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
func TestCompletionListForDerivedType1(t *testing.T) {
1313
t.Parallel()
14-
14+
t.Skip()
1515
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1616
const content = `interface IFoo {
1717
bar(): IFoo;

internal/fourslash/tests/gen/indexerReturnTypes1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func TestIndexerReturnTypes1(t *testing.T) {
1111
t.Parallel()
12-
t.Skip()
12+
1313
defer testutil.RecoverAndFail(t, "Panic on fourslash test")
1414
const content = `interface Numeric {
1515
[x: number]: Date;

0 commit comments

Comments
 (0)