Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ This file should be imported by eng/Versions.props
<optimizationwindows_ntx64MIBCRuntimePackageVersion>1.0.0-prerelease.25467.1</optimizationwindows_ntx64MIBCRuntimePackageVersion>
<optimizationwindows_ntx86MIBCRuntimePackageVersion>1.0.0-prerelease.25467.1</optimizationwindows_ntx86MIBCRuntimePackageVersion>
<!-- dotnet-roslyn dependencies -->
<MicrosoftCodeAnalysisPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisPackageVersion>
<MicrosoftCodeAnalysisCompilersPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisCompilersPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
<MicrosoftCodeAnalysisFeaturesPackageVersion>5.0.0-2.26217.6</MicrosoftCodeAnalysisFeaturesPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-2.26217.6</MicrosoftVisualStudioLanguageServicesPackageVersion>
<MicrosoftCodeAnalysisPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisPackageVersion>
<MicrosoftCodeAnalysisCompilersPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisCompilersPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
<MicrosoftCodeAnalysisFeaturesPackageVersion>5.0.0-2.26228.14</MicrosoftCodeAnalysisFeaturesPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-2.26228.14</MicrosoftVisualStudioLanguageServicesPackageVersion>
<!-- dotnet-runtime dependencies -->
<SystemCollectionsImmutablePackageVersion>9.0.0</SystemCollectionsImmutablePackageVersion>
<SystemComponentModelCompositionPackageVersion>9.0.0</SystemComponentModelCompositionPackageVersion>
Expand Down
32 changes: 16 additions & 16 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,37 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>9d5a6a9aa463d6d10b0b0ba6d5982cc82f363dc3</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Features" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis.Features" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Compilers" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.CodeAnalysis.Compilers" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.0.0-2.26217.6">
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.0.0-2.26228.14">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>7888e0d795d36806bbaf3cecea9fc61f6aac8279</Sha>
<Sha>83e5a53ac08744260899d5012e20e1102ba87403</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ type AsyncType() =
[<VolatileField>]
let mutable spinloop = true

let waitASec (t:Task) =
let result = t.Wait(TimeSpan(hours=0,minutes=0,seconds=1))
Assert.True(result, "Task did not finish after waiting for a second.")
// Use a generous timeout to avoid flaky failures on loaded CI machines where the thread pool may be saturated.
let waitForCompletion (t: Task) =
let result = t.Wait(TimeSpan.FromSeconds(30.0))
Assert.True(result, "Task did not finish after waiting for 30 seconds.")

[<Fact>]
member _.AsyncRunSynchronouslyReusesThreadPoolThread() =
Expand Down Expand Up @@ -153,34 +154,41 @@ type AsyncType() =
member _.CreateTask () =
let s = "Hello tasks!"
let a = async { return s }
use t : Task<string> = Async.StartAsTask a
waitASec t
let t : Task<string> = Async.StartAsTask a
waitForCompletion t
Assert.True (t.IsCompleted)
Assert.AreEqual(s, t.Result)

[<Fact>]
member _.StartAsTaskCancellation () =
let cts = new CancellationTokenSource()
let asyncStarted = new ManualResetEventSlim(false)
let doSpinloop () = while spinloop do ()
let a = async {
asyncStarted.Set()
cts.CancelAfter (100)
doSpinloop()
}

use t : Task<unit> = Async.StartAsTask(a, cancellationToken = cts.Token)
let t : Task<unit> = Async.StartAsTask(a, cancellationToken = cts.Token)

// Wait for the async body to actually start executing before checking timing.
Assert.True(asyncStarted.Wait(30_000), "Async body did not start within 30 seconds")

// Should not finish, we don't eagerly mark the task done just because it's been signaled to cancel.
try
let result = t.Wait(300)
let result = t.Wait(1000)
Assert.False (result)
with :? AggregateException -> Assert.Fail "Task should not finish, yet"

spinloop <- false

try
waitASec t
let result = t.Wait(TimeSpan(hours=0,minutes=0,seconds=5))
Assert.True(result, "Task did not finish after waiting for 5 seconds.")
with :? AggregateException as a ->
match a.InnerException with
| :? TaskCanceledException as t -> ()
| :? TaskCanceledException -> ()
| _ -> reraise()

Assert.True (t.IsCompleted, "Task is not completed")
Expand All @@ -204,7 +212,7 @@ type AsyncType() =
innerTcs.SetResult ()

try
waitASec tcs.Task
waitForCompletion tcs.Task
with :? AggregateException as a ->
match a.InnerException with
| :? TaskCanceledException -> ()
Expand Down Expand Up @@ -247,14 +255,17 @@ type AsyncType() =

[<Fact>]
member _.CancellationPropagatesToTask () =
let ewh = new ManualResetEvent(false)
let a = async {
ewh.Set() |> Assert.True
while true do ()
}
let t = Async.StartAsTask a
ewh.WaitOne() |> Assert.True
Async.CancelDefaultToken ()
let mutable exceptionThrown = false
try
t.Wait()
waitForCompletion t
with e -> exceptionThrown <- true
Assert.True (exceptionThrown)
Assert.True(t.IsCanceled)
Expand Down Expand Up @@ -287,17 +298,17 @@ type AsyncType() =
member _.CreateImmediateAsTask () =
let s = "Hello tasks!"
let a = async { return s }
use t : Task<string> = Async.StartImmediateAsTask a
waitASec t
let t : Task<string> = Async.StartImmediateAsTask a
waitForCompletion t
Assert.True (t.IsCompleted)
Assert.AreEqual(s, t.Result)

[<Fact>]
member _.StartImmediateAsTask () =
let s = "Hello tasks!"
let a = async { return s }
use t = Async.StartImmediateAsTask a
waitASec t
let t = Async.StartImmediateAsTask a
waitForCompletion t
Assert.True (t.IsCompleted)
Assert.AreEqual(s, t.Result)

Expand Down
Loading