Skip to content

Commit e0a02a0

Browse files
committedAug 31, 2023
Try to mitigate code folding test failures
Code folding is one of the earliest LSP requests we get, and unlike semantic tokens we don't have an opportunity to tell the client we are ready to answer them. Hopefully a wait and a text change will improve the tests.
1 parent 771305e commit e0a02a0

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed
 

‎src/Razor/test/Microsoft.VisualStudio.Razor.IntegrationTests/CodeFoldingTests.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static CollapsibleBlock ConvertToLineNumbers(Span span, ITextView textView)
123123
}
124124
}
125125

126-
[IdeFact(Skip = "Flaky after multitarget work")]
126+
[IdeFact]
127127
public async Task CodeFolding_CodeBlock()
128128
{
129129
await TestServices.SolutionExplorer.AddFileAsync(
@@ -147,6 +147,10 @@ private void IncrementCount()
147147
open: true,
148148
ControlledHangMitigatingCancellationToken);
149149

150+
await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken);
151+
152+
TestServices.Input.Send("{ENTER}");
153+
150154
await AssertFoldableBlocksAsync(
151155
@"@code {
152156
private int currentCount = 0;
@@ -190,6 +194,10 @@ await TestServices.SolutionExplorer.AddFileAsync(
190194
open: true,
191195
ControlledHangMitigatingCancellationToken);
192196

197+
await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken);
198+
199+
TestServices.Input.Send("{ENTER}");
200+
193201
await AssertFoldableBlocksAsync(
194202
@"@if(true)
195203
{
@@ -232,6 +240,10 @@ await TestServices.SolutionExplorer.AddFileAsync(
232240
open: true,
233241
ControlledHangMitigatingCancellationToken);
234242

243+
await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken);
244+
245+
TestServices.Input.Send("{ENTER}");
246+
235247
await AssertFoldableBlocksAsync(
236248
@"@foreach (var s in GetStuff())
237249
{
@@ -265,6 +277,10 @@ void M2() { }
265277
open: true,
266278
ControlledHangMitigatingCancellationToken);
267279

280+
await TestServices.Editor.WaitForComponentClassificationAsync(ControlledHangMitigatingCancellationToken);
281+
282+
TestServices.Input.Send("{ENTER}");
283+
268284
await AssertFoldableBlocksAsync(
269285
@"#region Methods
270286
void M1() { }

0 commit comments

Comments
 (0)