Skip to content

Parallelize tests #17872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 90 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0ed0442
rebase
majocha Oct 21, 2024
72ae0c6
Merge branch 'main' into parallel-tests
majocha Oct 23, 2024
612a7b3
Merge branch 'main' into parallel-tests
majocha Oct 23, 2024
f2795ee
merge main
majocha Oct 24, 2024
d384a06
Merge branch 'main' into parallel-tests
majocha Oct 24, 2024
7a94530
Merge remote-tracking branch 'dotnet/main' into parallel-tests
majocha Oct 25, 2024
e93a33e
orchestrate instead of Async.Sleep
majocha Oct 25, 2024
47d9cdc
xunit customizations behind conditional compilation
majocha Oct 25, 2024
4a5ba8f
Merge branch 'main' into parallel-tests
majocha Oct 25, 2024
7359bdf
Merge branch 'main' into parallel-tests
majocha Oct 27, 2024
83c5b98
make console capture explicit
majocha Oct 27, 2024
1ef5c8d
diff
majocha Oct 28, 2024
e665e79
try fix test
majocha Oct 28, 2024
efc4c28
lazy pattern
majocha Oct 28, 2024
1b00731
reenable extras
majocha Oct 28, 2024
01cc1f8
Merge branch 'main' into parallel-tests
majocha Oct 29, 2024
d571d69
Merge branch 'main' into parallel-tests
majocha Oct 30, 2024
c55a24a
Merge branch 'main' into parallel-tests
majocha Nov 2, 2024
c9bb2a1
Merge branch 'main' into parallel-tests
majocha Nov 4, 2024
8e1224f
test temptath
majocha Nov 4, 2024
e0db816
cleaup test dir
majocha Nov 5, 2024
e15c236
Merge branch 'main' into parallel-tests
majocha Nov 5, 2024
2d352e0
Merge branch 'main' into parallel-tests
majocha Nov 6, 2024
4b3a715
Merge branch 'main' into parallel-tests
majocha Nov 6, 2024
3c30bfd
merge main
majocha Nov 7, 2024
01d0003
remove unneeded file
majocha Nov 7, 2024
9342877
fix merge
majocha Nov 7, 2024
466806c
Merge branch 'main' into parallel-tests
majocha Nov 7, 2024
1214470
Merge branch 'main' into parallel-tests
majocha Nov 7, 2024
c6ab446
another shot at fixing gc test
majocha Nov 7, 2024
d3abe3f
another attempt at improving Async.Parallel test
majocha Nov 7, 2024
7ed73fa
Merge branch 'main' into parallel-tests
majocha Nov 8, 2024
3f833eb
smaller diff
majocha Nov 8, 2024
f570af8
merge main
majocha Nov 9, 2024
e16eec6
Merge branch 'main' into parallel-tests
majocha Nov 11, 2024
5effb6e
Merge branch 'main' into parallel-tests
majocha Nov 12, 2024
7d8e06d
restore test
majocha Nov 12, 2024
83c7f8f
restore tests
majocha Nov 12, 2024
8422977
merge main
majocha Nov 13, 2024
fdd1b6d
diff
majocha Nov 13, 2024
f838e7e
unblock service tests
majocha Nov 14, 2024
364d033
rename attributes
majocha Nov 14, 2024
b33f559
fix
majocha Nov 14, 2024
feb7d1e
revert - should now work without
majocha Nov 14, 2024
399b2ce
add comment
majocha Nov 14, 2024
e845df2
diff
majocha Nov 14, 2024
98463f6
diff
majocha Nov 14, 2024
ab1263f
just exclude gc test
majocha Nov 14, 2024
7d467e9
diff
majocha Nov 14, 2024
902c587
Merge branch 'main' into parallel-tests
majocha Nov 15, 2024
0379175
exclude test case
majocha Nov 15, 2024
ab1cfaa
Merge branch 'main' into parallel-tests
majocha Nov 18, 2024
fe6014f
Merge branch 'main' into parallel-tests
majocha Nov 19, 2024
ed7f210
Merge branch 'main' into parallel-tests
majocha Nov 19, 2024
ee7bd16
try to trigger clr error in ci
majocha Nov 21, 2024
859b091
Merge branch 'main' into parallel-tests
majocha Nov 21, 2024
18fed2d
Merge branch 'main' into parallel-tests
majocha Nov 22, 2024
eb247bc
Merge branch 'main' into parallel-tests
majocha Nov 26, 2024
b82d179
Merge branch 'main' into parallel-tests
vzarytovskii Nov 26, 2024
4c6f29e
Merge branch 'main' into parallel-tests
majocha Nov 26, 2024
7fceaf6
Merge branch 'main' into parallel-tests
vzarytovskii Nov 26, 2024
361146d
try unflake test
majocha Nov 27, 2024
a83d460
unflake asyncmemo
majocha Nov 27, 2024
fe658af
Merge branch 'main' into parallel-tests
majocha Nov 27, 2024
3007cb5
ilverify
majocha Nov 27, 2024
1864ac6
merge main
majocha Dec 2, 2024
135c8b6
Merge branch 'main' into parallel-tests
majocha Dec 3, 2024
147c44c
Merge branch 'main' into parallel-tests
majocha Dec 4, 2024
d394350
Merge branch 'main' into parallel-tests
majocha Dec 7, 2024
052de85
Merge branch 'main' into parallel-tests
majocha Dec 9, 2024
0c25cb6
Merge branch 'main' into parallel-tests
majocha Dec 9, 2024
d6f614a
fix merge
majocha Dec 9, 2024
b970775
Merge branch 'main' into parallel-tests
majocha Dec 10, 2024
190c799
some cleanup
majocha Dec 10, 2024
aabae01
Update tests/fsharp/Compiler/CodeGen/EmittedIL/DeterministicTests.fs
majocha Dec 10, 2024
c0b2848
Merge branch 'main' into parallel-tests
majocha Dec 10, 2024
0f0034c
remove timeout
majocha Dec 10, 2024
02c6d56
Make FsiTests sequential
majocha Dec 10, 2024
144e434
restore ci throttling
majocha Dec 10, 2024
f172a76
Merge branch 'main' into parallel-tests
psfinaki Dec 11, 2024
afa75ca
min diff
majocha Dec 11, 2024
ddcb81a
add comment
majocha Dec 11, 2024
1e6635f
Merge branch 'main' into parallel-tests
majocha Dec 12, 2024
8450c77
bring down the parallelizm a notch on mac and linux
majocha Dec 12, 2024
2891237
Merge branch 'main' into parallel-tests
majocha Dec 12, 2024
e7e98e7
Merge branch 'main' into parallel-tests
psfinaki Dec 13, 2024
d45691c
Merge branch 'main' into parallel-tests
majocha Dec 13, 2024
01bd060
Merge branch 'main' into parallel-tests
majocha Dec 13, 2024
af93ab8
Merge branch 'main' into parallel-tests
majocha Dec 16, 2024
d78dcbf
Merge branch 'main' into parallel-tests
KevinRansom Dec 16, 2024
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
50 changes: 28 additions & 22 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -362,14 +362,16 @@ function VerifyAssemblyVersionsAndSymbols() {
}
}

function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false) {
function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [string]$testadapterpath, [boolean] $asBackgroundJob = $false, [string] $settings = "") {
$dotnetPath = InitializeDotNetCli
$dotnetExe = Join-Path $dotnetPath "dotnet.exe"
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject)
$testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml"
# {assembly} and {framework} will expand respectively. See https://github.com/spekt/testlogger/wiki/Logger-Configuration#logfilepath
# This is useful to deconflict log filenames when there are many test assemblies, e.g. when testing a whole solution.
$testLogPath = "$ArtifactsDir\TestResults\$configuration\{assembly}_{framework}.xml"
$testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog"
$args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path $testadapterpath --logger ""xunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath"
$args += " --blame --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=false"
$args += " --blame --blame-hang-timeout 5minutes --results-directory $ArtifactsDir\TestResults\$configuration -p:vstestusemsbuildoutput=true"

if (-not $noVisualStudio -or $norestore) {
$args += " --no-restore"
Expand All @@ -379,17 +381,20 @@ function TestUsingMSBuild([string] $testProject, [string] $targetFramework, [str
$args += " --no-build"
}

$args += " $settings"

if ($asBackgroundJob) {
Write-Host
Write-Host("Starting on the background: $args")
Write-Host("------------------------------------")
$bgJob = Start-Job -ScriptBlock {
& $using:dotnetExe test $using:testProject -c $using:configuration -f $using:targetFramework -v n --test-adapter-path $using:testadapterpath --logger "xunit;LogFilePath=$using:testLogPath" /bl:$using:testBinLogPath --blame --results-directory $using:ArtifactsDir\TestResults\$using:configuration
Start-Job -ScriptBlock {
$argArray = $using:args -Split " "
& $using:dotnetExe $argArray
if ($LASTEXITCODE -ne 0) {
throw "Command failed to execute with exit code $($LASTEXITCODE): $using:dotnetExe $using:args"
}
}
return $bgJob
} else{
} else {
Write-Host("$args")
Exec-Console $dotnetExe $args
}
Expand Down Expand Up @@ -595,21 +600,20 @@ try {
$script:BuildCategory = "Test"
$script:BuildMessage = "Failure running tests"

if ($testCoreClr) {
$bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true

TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Service.Tests\FSharp.Compiler.Service.Tests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Service.Tests\"
TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.Private.Scripting.UnitTests\FSharp.Compiler.Private.Scripting.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.Private.Scripting.UnitTests\"
TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"
function Receive($job) {
while($job.HasMoreData) {
Receive-Job $job | Write-Host
Start-Sleep -Seconds 1
}
Receive-Job $job -Wait -ErrorAction Stop
}

# Collect output from background jobs
Wait-job $bgJob | out-null
Receive-Job $bgJob -ErrorAction Stop
if ($testCoreClr) {
$cpuLimit = if ($ci) { "-m:2 -- xUnit.MaxParallelThreads=0.25x" } else { "" }
TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:coreclrTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\" -settings $cpuLimit
}

if ($testDesktop) {
if ($testDesktop -and $ci) {
$bgJob = TestUsingMSBuild -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharpSuite.Tests\" -asBackgroundJob $true

TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Compiler.ComponentTests\FSharp.Compiler.ComponentTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
Expand All @@ -618,9 +622,11 @@ try {
TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Build.UnitTests\"
TestUsingMSBuild -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Core.UnitTests\"

# Collect output from background jobs
Wait-job $bgJob | out-null
Receive-Job $bgJob -ErrorAction Stop
Receive -job $bgJob
}

if ($testDesktop -and -not $ci ) {
TestUsingMSBuild -testProject "$RepoRoot\FSharp.sln" -targetFramework $script:desktopTargetFramework -testadapterpath "$ArtifactsDir\bin\FSharp.Compiler.ComponentTests\"
}

if ($testFSharpQA) {
Expand Down
3 changes: 2 additions & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ function Test() {
projectname=$(basename -- "$testproject")
projectname="${projectname%.*}"
testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"xunit;LogFilePath=$testlogpath\" --blame-hang-timeout 5minutes --results-directory $artifacts_dir/TestResults/$configuration -p:vstestusemsbuildoutput=false"
args+=" -- xUnit.MaxParallelThreads=3"
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<PropertyGroup>
<TargetFrameworks>net472;$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
Expand All @@ -18,6 +18,12 @@
<Compile Include="MapSourceRootsTests.fs" />
</ItemGroup>

<ItemGroup>
<Content Include="xunit.runner.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(FSharpSourcesRoot)\FSharp.Build\FSharp.Build.fsproj" />
<ProjectReference Include="$(FSharpSourcesRoot)\FSharp.Core\FSharp.Core.fsproj" />
Expand Down
5 changes: 5 additions & 0 deletions tests/FSharp.Build.UnitTests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"appDomain": "denied",
"parallelizeAssembly": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ open FSharp.Test
open FSharp.Test.Compiler
open System

[<Collection(nameof NotThreadSafeResourceCollection)>]
module utf8output =

[<Fact>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ open FSharp.Test.Compiler
open System
open System.IO

// reportTime uses global state.
[<Collection(nameof NotThreadSafeResourceCollection)>]
module times =

// This test was automatically generated (moved from FSharpQA suite - CompilerOptions/fsc/times)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ let internal observe (cache: AsyncMemoize<_,_,_>) =

cache.Event.Add arrivals.Post

let next () = collected.Receive(10_000)
let next () = collected.Receive()

next

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ let success =
asm.Version.Major = 1 &&
asm.Version.Minor = 2 &&
asm.Version.Build = 3 &&
(abs (asm.Version.Revision - (int defaultRevision))) < 10 // default value is seconds in the current day / 2. Check if within 10 sec of that.
(abs (asm.Version.Revision - (int defaultRevision))) < 60 // default value is seconds in the current day / 2. Check if within 60 sec of that.
if success then () else failwith "Failed: 1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ open Xunit
open FSharp.Test
open FSharp.Test.Compiler

[<Collection(nameof NotThreadSafeResourceCollection)>]
module Events =

let verifyCompile compilation =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module FSharpChecker.TransparentCompiler
[<Xunit.Collection(nameof FSharp.Test.NotThreadSafeResourceCollection)>]
module FSharpChecker.TransparentCompiler

open System.Collections.Concurrent
open System.Diagnostics
Expand Down Expand Up @@ -991,6 +992,8 @@ type private LoadClosureTestShim(currentFileSystem: IFileSystem) =
?shouldShadowCopy = shouldShadowCopy
)

// Because it is mutating FileSystem!
[<Collection(nameof NotThreadSafeResourceCollection)>]
module TestsMutatingFileSystem =

[<Theory>]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

// Because of shared fsi session.
[<FSharp.Test.RunTestCasesInSequence>]
module Language.BooleanReturningAndReturnTypeDirectedPartialActivePatternTests

open Xunit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.

// Run sequentially because of shared fsiSession.
[<FSharp.Test.RunTestCasesInSequence>]
module Language.SequenceExpression.SequenceExpressionTests

open FSharp.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ module ScriptRunner =
let res = evalScriptFromDiskInSharedSession engine cu
match res with
| CompilationResult.Failure _ -> res
| CompilationResult.Success s ->
| CompilationResult.Success _ ->
if capture.OutText |> TestFramework.outputPassed then
res
else
failwith $"Results looked correct, but 'TEST PASSED OK' was not printed. Result: %A{s}"
failwith $"Results looked correct, but 'TEST PASSED OK' was not printed."

| _ -> failwith $"Compilation unit other than fsharp is not supported, cannot process %A{cu}"
| _ ->
printfn $"Cannot process %A{cu}"
failwith $"Compilation unit other than fsharp is not supported."

/// This test file was created by porting over (slower) FsharpSuite.Tests
/// In order to minimize human error, the test definitions have been copy-pasted and this adapter provides implementations of the test functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,17 @@ let ``comprehensions-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehens
[<Fact>]
let ``comprehensions-FSI`` () = singleTestBuildAndRun "core/comprehensions" FSI

[<Fact>]
let ``comprehensionshw-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_DEBUG
// Cancels default token.
[<Collection(nameof NotThreadSafeResourceCollection)>]
module Comprehensionshw =
[<Fact>]
let ``comprehensionshw-FSC_DEBUG`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_DEBUG

[<Fact>]
let ``comprehensionshw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_OPTIMIZED
[<Fact>]
let ``comprehensionshw-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/comprehensions-hw" FSC_OPTIMIZED

[<Fact>]
let ``comprehensionshw-FSI`` () = singleTestBuildAndRun "core/comprehensions-hw" FSI
[<Fact>]
let ``comprehensionshw-FSI`` () = singleTestBuildAndRun "core/comprehensions-hw" FSI

[<Fact>]
let ``genericmeasures-FSC_DEBUG`` () = singleTestBuildAndRun "core/genericmeasures" FSC_DEBUG
Expand Down Expand Up @@ -375,18 +378,21 @@ let ``recordResolution-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/recordRe
[<Fact>]
let ``recordResolution-FSI`` () = singleTestBuildAndRun "core/recordResolution" FSI

// This test has hardcoded expectations about current synchronization context
// Will be moved out of FsharpSuite.Tests in a later phase for desktop framework
[<FactForNETCOREAPP>]
let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED
// Cancels default token.
[<Collection(nameof NotThreadSafeResourceCollection)>]
module CoreControl =
// This test has hardcoded expectations about current synchronization context
// Will be moved out of FsharpSuite.Tests in a later phase for desktop framework
[<FactForNETCOREAPP>]
let ``control-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/control" FSC_OPTIMIZED

[<FactForNETCOREAPP>]
let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI
[<FactForNETCOREAPP>]
let ``control-FSI`` () = singleTestBuildAndRun "core/control" FSI

[<FactForNETCOREAPP>]
let ``control --tailcalls`` () =
let cfg = "core/control"
singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED
[<FactForNETCOREAPP>]
let ``control --tailcalls`` () =
let cfg = "core/control"
singleTestBuildAndRunAux cfg ["--tailcalls"] FSC_OPTIMIZED

[<Fact>]
let ``controlChamenos-FSC_OPTIMIZED`` () =
Expand All @@ -401,7 +407,7 @@ let ``controlChamenos-FSI`` () =
[<Fact>]
let ``controlMailbox-FSC_OPTIMIZED`` () = singleTestBuildAndRun "core/controlMailbox" FSC_OPTIMIZED

[<Fact(Skip="Flaky")>]
[<Fact>]
let ``controlMailbox-FSI`` () = singleTestBuildAndRun "core/controlMailbox" FSI

[<Fact>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open FSharp.Compiler.GraphChecking
open FSharp.Compiler.Text
open FSharp.Compiler.Syntax

let private checker = FSharpChecker.Create()
open FSharp.Test

let parseSourceCode (name: string, code: string) =
let sourceText = SourceText.ofString code
Expand All @@ -16,7 +16,7 @@ let parseSourceCode (name: string, code: string) =
}

let result =
checker.ParseFile(name, sourceText, parsingOptions) |> Async.RunSynchronously
CompilerAssert.Checker.ParseFile(name, sourceText, parsingOptions) |> Async.RunSynchronously

result.ParseTree

Expand Down
3 changes: 1 addition & 2 deletions tests/FSharp.Compiler.ComponentTests/xunit.runner.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"appDomain": "denied",
"parallelizeTestCollections": false,
"maxParallelThreads": 1
"parallelizeAssembly": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module Native =

type scriptHost (?langVersion: LangVersion) = inherit FSharpScript(langVersion=defaultArg langVersion LangVersion.Preview)

[<Collection(nameof NotThreadSafeResourceCollection)>]
type DependencyManagerInteractiveTests() =

let getValue ((value: Result<FsiValue option, exn>), (errors: FSharpDiagnostic[])) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<TargetFrameworks>net472;$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Unix' or '$(BUILDING_USING_DOTNET)' == 'true'">$(FSharpNetCoreProductTargetFramework)</TargetFrameworks>
<OutputType>Library</OutputType>
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<UnitTestType>xunit</UnitTestType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"appDomain": "denied",
"parallelizeTestCollections": false,
"maxParallelThreads": 1
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
"appDomain": "denied",
"parallelizeAssembly": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let private projectOptions : FSharpProjectOptions =
UnresolvedReferences = None
Stamp = None }

let private checker = FSharpChecker.Create(useTransparentCompiler=CompilerAssertHelpers.UseTransparentCompiler)
let private checker = FSharpChecker.Create(useTransparentCompiler = CompilerAssertHelpers.UseTransparentCompiler)

let private assertAreEqual (expected, actual) =
if actual <> expected then
Expand Down
7 changes: 0 additions & 7 deletions tests/FSharp.Compiler.Service.Tests/AssemblyInfo.fs

This file was deleted.

2 changes: 1 addition & 1 deletion tests/FSharp.Compiler.Service.Tests/Common.fs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Async with
task.Result

// Create one global interactive checker instance
let checker = FSharpChecker.Create(useTransparentCompiler=FSharp.Compiler.CompilerConfig.FSharpExperimentalFeaturesEnabledAutomatically)
let checker = FSharpChecker.Create(useTransparentCompiler = FSharp.Test.CompilerAssertHelpers.UseTransparentCompiler)

type TempFile(ext, contents: string) =
let tmpFile = Path.ChangeExtension(getTemporaryFileName (), ext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
<Content Include="expected-help-output.bsl">
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
</Content>
<Compile Include="AssemblyInfo.fs" />
<Compile Include="SurfaceArea.fs" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<Compile Include="..\FSharp.Test.Utilities\XunitSetup.fs">
<Link>XunitSetup.fs</Link>
Expand Down
2 changes: 2 additions & 0 deletions tests/FSharp.Compiler.Service.Tests/FileSystemTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ let file2 = """
module File2
let B = File1.A + File1.A"""

// FileSystem is a global shared resource.
[<Collection(nameof NotThreadSafeResourceCollection)>]
type internal MyFileSystem() =
inherit DefaultFileSystem()
static member FilesCache = dict [(fileName1, file1); (fileName2, file2)]
Expand Down
1 change: 0 additions & 1 deletion tests/FSharp.Compiler.Service.Tests/FsiHelpTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
open FSharp.Test.Assert
open Xunit

[<CollectionDefinition("FsiHelpTests", DisableParallelization = false)>]
module FsiHelpTests =

[<Fact>]
Expand Down
Loading
Loading