haskell-distributed / haskell-distributed/distributed-process

testConnectToSelf failing

Open
#444 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

network-transport-tests
Dominant language
Haskell
Stars
751
Forks
99
Avg merge
45m
Merged PRs (30d)
2

Description

On line 451 of TestTransport.hs :
https://github.com/haskell-distributed/distributed-process/blob/edsko/network-transport-2/tests/TestTransport.hs#L451

If I add another line beneath this, so that two connections are made between an endpoint and its own address, then the 'testConnectToSelf' fails. e.g.

testConnectToSelf :: Transport -> Int -> IO ()
testConnectToSelf transport numPings = do
  done <- newEmptyMVar
  Right endpoint <- newEndPoint transport

  tlog "Creating self-connection"
  Right conn <- connect endpoint (address endpoint) ReliableOrdered
  Right dummyConn1 <- connect endpoint (address endpoint) ReliableOrdered

It is throwning an error for line 473 :
https://github.com/haskell-distributed/distributed-process/blob/edsko/network-transport-2/tests/TestTransport.hs#L473

where (Received cid' msg) is not correctly being pattern matched:

Running "ConnectToSelf": failed (exception: TestTransport.hs:473:46-99: Non-exhaustive patterns in lambda

So - having multiple connections from an endpoint to its address appears to be causing problems.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tests/TestTransport.hs around lines 451 and 473 and run the ConnectToSelf test. Reproduce the failure by making two connections from an endpoint to its own address, then trace the received-message pattern matching. Done means testConnectToSelf passes with multiple self-connections.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
distributed-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.