Skip to content

Commit

Permalink
[tests] Use a random port for these tests
Browse files Browse the repository at this point in the history
This reduces the chance of a collision when tests run
in parallel.
  • Loading branch information
alanmcgovern committed May 25, 2020
1 parent b4b23a4 commit c845c63
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/MonoTorrent.Tests/Client/TestWebSeed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class WebSeedTests
HttpConnection connection;
HttpListener listener;
//private RequestMessage m;
public const string ListenerURL = "http://127.0.0.1:51423/announce/";
public string ListenerURL;

PeerId id;
RequestBundle requests;
Expand All @@ -66,6 +66,7 @@ public class WebSeedTests
public void FixtureSetup ()
{
listener = new HttpListener ();
ListenerURL = $"http://127.0.0.1:{new Random ().Next (10000, 50000)}/announce/";
listener.Prefixes.Add (ListenerURL);
listener.Start ();

Expand Down

0 comments on commit c845c63

Please sign in to comment.