Skip to content

Commit 5f0c467

Browse files
committed
Improve test performance
1 parent a14aacb commit 5f0c467

File tree

1 file changed

+3
-2
lines changed
  • src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework.UnitTests/Mocks

1 file changed

+3
-2
lines changed

src/Features/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework.UnitTests/Mocks/TestMethodHandlers.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System;
66
using System.Threading;
77
using System.Threading.Tasks;
8+
using Microsoft.VisualStudio.Threading;
89

910
namespace Microsoft.CommonLanguageServerProtocol.Framework.UnitTests;
1011

@@ -111,7 +112,7 @@ public async Task<string> HandleRequestAsync(int request, TestRequestContext con
111112
{
112113
return "I completed!";
113114
}
114-
await Task.Delay(100);
115+
await Task.Delay(100, cancellationToken).NoThrowAwaitable();
115116
}
116117
}
117118
}
@@ -130,7 +131,7 @@ public async Task<string> HandleRequestAsync(int request, TestRequestContext con
130131
while (true)
131132
{
132133
cancellationToken.ThrowIfCancellationRequested();
133-
await Task.Delay(100);
134+
await Task.Delay(100, cancellationToken).NoThrowAwaitable();
134135
}
135136
}
136137
}

0 commit comments

Comments
 (0)