Closed simonweijgers closed 4 years ago
Yep, good find. Whenever I have time to spend I'll take a look at reworking that test. Happy to pull in a PR in the meantime.
Closed by 1d334ef
The test is still disabled due to issues on Linux, but passes on OSX and Windows. You can comment out the skip to try out, but this demonstrates a more sound approach to the multi-process example.
LightningDB.Tests/MultiProcessTests.cs
doesn't test loading from multiple processes but from same process (multiple .Net AppDomains are contained within the same OS process).The following illustrates this:
Create file called secondapp.fsx with following contents:
Compile to dll: fsc.exe secondapp.fsx --target:library
Create firstapp.fsx with following contents:
System.Console.WriteLine("Hello from first app, my PID is: " + string(System.Diagnostics.Process.GetCurrentProcess().Id))
let secondDomain = System.AppDomain.CreateDomain("2nd Process") let secondAppType = typeof
let app = secondDomain.CreateInstanceFromAndUnwrap("secondapp.dll", secondAppType.FullName); System.Threading.Thread.Sleep(5000)
Hello from first app, my PID is: 8168 Hello from second app, my PID is: 8168