Skip to content
Merged
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
4 changes: 4 additions & 0 deletions azure-pipelines-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ stages:

- script: eng\CIBuildNoPublish.cmd -compressallmetadata -buildnorealsig -testDesktop -configuration Release -testBatch $(System.JobPositionInPhase)
env:
FSharp_CacheEvictionImmediate: true
DOTNET_DbgEnableMiniDump: 1
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
Expand Down Expand Up @@ -456,11 +457,13 @@ stages:
fsharpqa_release:
_configuration: Release
_testKind: testFSharpQA
FSharp_CacheEvictionImmediate: true
transparentCompiler:
vs_release:
_configuration: Release
_testKind: testVs
setupVsHive: true
FSharp_CacheEvictionImmediate: true
transparentCompiler:
transparent_compiler_release:
_configuration: Release
Expand Down Expand Up @@ -559,6 +562,7 @@ stages:

- script: eng\CIBuildNoPublish.cmd -compressallmetadata -configuration Release -testDesktop -testBatch $(System.JobPositionInPhase)
env:
FSharp_CacheEvictionImmediate: true
DOTNET_DbgEnableMiniDump: 1
DOTNET_DbgMiniDumpType: 3 # Triage dump, 1 for mini, 2 for Heap, 3 for triage, 4 for full. Don't use 4 unless you know what you're doing.
DOTNET_DbgMiniDumpName: $(Build.SourcesDirectory)\artifacts\log\Release\$(Build.BuildId)-%e-%p-%t.dmp
Expand Down
13 changes: 12 additions & 1 deletion src/Compiler/Utilities/Caches.fs
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,23 @@ type CacheOptions<'Key> =
}

module CacheOptions =
let forceImmediate =
try
Environment.GetEnvironmentVariable("FSharp_CacheEvictionImmediate") <> null
with _ ->
false

let defaultEvictionMode =
if forceImmediate then
EvictionMode.Immediate
else
EvictionMode.MailboxProcessor

let getDefault comparer =
{
CacheOptions.TotalCapacity = 1024
CacheOptions.HeadroomPercentage = 50
CacheOptions.EvictionMode = EvictionMode.MailboxProcessor
CacheOptions.EvictionMode = defaultEvictionMode
CacheOptions.Comparer = comparer
}

Expand Down
1 change: 1 addition & 0 deletions tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<NoOptimizationData>false</NoOptimizationData>
<NoInterfaceData>false</NoInterfaceData>
<CompressMetadata>true</CompressMetadata>
<ServerGarbageCollection>true</ServerGarbageCollection>
</PropertyGroup>

</Project>
8 changes: 5 additions & 3 deletions tests/FSharp.Test.Utilities/CompilerAssert.fs
Original file line number Diff line number Diff line change
Expand Up @@ -376,23 +376,25 @@ module CompilerAssertHelpers =
let setup = AppDomainSetup(ApplicationBase = thisAssemblyDirectory)
let testCaseDomain = AppDomain.CreateDomain($"built app {assembly}", null, setup)

testCaseDomain.add_AssemblyResolve(fun _ args ->
let handler = ResolveEventHandler(fun _ args ->
dependecies
|> List.tryFind (fun path -> Path.GetFileNameWithoutExtension path = AssemblyName(args.Name).Name)
|> Option.filter FileSystem.FileExistsShim
|> Option.map Assembly.LoadFile
|> Option.toObj
)

testCaseDomain.add_AssemblyResolve handler

let worker =
(testCaseDomain.CreateInstanceFromAndUnwrap(typeof<Worker>.Assembly.CodeBase, typeof<Worker>.FullName)) :?> Worker

let outcome, output, errors = worker.ExecuteTestCase assembly isFsx
// Replay streams captured in appdomain.
printf $"{output}"
eprintf $"{errors}"
AppDomain.Unload testCaseDomain

testCaseDomain.remove_AssemblyResolve handler

outcome, output, errors

Expand Down
1 change: 1 addition & 0 deletions tests/FSharp.Test.Utilities/XunitHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ module OneTimeSetup =
log "Adding AssemblyResolver"
AssemblyResolver.addResolver ()
#endif
log $"Server GC enabled: {System.Runtime.GCSettings.IsServerGC}"
log "Installing TestConsole redirection"
TestConsole.install()

Expand Down
Loading