Skip to content

Commit

Permalink
stop using NamedPipeStream in test
Browse files Browse the repository at this point in the history
* Since it does not work in CI environment
  • Loading branch information
joemphilips committed May 19, 2022
1 parent 7786af8 commit 51f144d
Showing 1 changed file with 5 additions and 23 deletions.
28 changes: 5 additions & 23 deletions tests/DotNetLightning.ClnRpc.Tests/Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,11 @@ module TestHelpers =
[<Literal>]
let PipeName = "SamplePipe1"

let serverPipe() =
new NamedPipeServerStream(
PipeName,
PipeDirection.InOut,
NamedPipeServerStream.MaxAllowedServerInstances,
PipeTransmissionMode.Byte,
PipeOptions.Asynchronous
)

let clientPipe() =
new NamedPipeClientStream(
".",
PipeName,
PipeDirection.InOut,
PipeOptions.Asynchronous
)
let struct (serverPipe, clientPipe) =
Nerdbank.Streams.FullDuplexStream.CreatePair()

let inline getClientProxy<'T when 'T: not struct>() =
let pipe = clientPipe()
let pipe = clientPipe

let handler =
let formatter = new JsonMessageFormatter()
Expand All @@ -158,16 +144,12 @@ module TestHelpers =

new NewLineDelimitedMessageHandler(pipe, pipe, formatter)

task {
do! pipe.ConnectAsync()
return JsonRpc.Attach<'T>(handler)
}
task { return JsonRpc.Attach<'T>(handler) }

let inline createRpcServer<'T when 'T: not struct>(server: 'T) =
task {
while true do
let pipe = serverPipe()
do! pipe.WaitForConnectionAsync()
let pipe = serverPipe

let handler =
let formatter = new JsonMessageFormatter()
Expand Down

0 comments on commit 51f144d

Please sign in to comment.