3

I am looking at writing some integration tests that will ensure my messaging layers behaves correctly upon lost packets/network issues as I need to be sure there will be no duplicates when a process reconnects either end of the connection, ideally not keeping a list of received messages.

TCP is used a the Connection Protocol

Test Scenarios I want to test are:

  1. Sender Cannot connect (easy enough to test by connecting to non existent server)
  2. Server receives but something happens in between TCP and Application Layer on Client when receiving confirmation, after the TCP ACK. E.g. server thinks its ACK'ed, client never receives it. (is this a viable worry in any application?)

I am currently thinking of implementing a new process that will act as a proxy for TCP connection, and connect to it via WCF from the integration test to configure the forwarding initially and then switch it on/off, or decide which packets get forwarded and which don't via a callback in the test. Therefore can simulate a scenario like that.

  1. Is there something like that already in C#?
  2. Has someone tried this already and failed? Why?
  3. Is there a better approach (especially for message based testing)?
Darek Kay
  • 15,827
  • 7
  • 64
  • 61
Michal Ciechan
  • 13,492
  • 11
  • 76
  • 118
  • im prettty sure all the lower levels are already handled by wcf/drivers/hardware... just try catch... – Nahum May 26 '15 at 20:29
  • 1
    possible duplicate of [How to simulate network packet loss when streaming video?](http://stackoverflow.com/questions/29497283/how-to-simulate-network-packet-loss-when-streaming-video) – Viktor Malyi May 27 '15 at 06:34
  • @ViktorMalyi From that answer: *tool supports only Linux platforms and Python 2.7.*. Definitely not looking to install Linux just for this :| – Michal Ciechan May 27 '15 at 11:27

0 Answers0