In fact, perhaps they should run somewhere else by default.
Yep, in the final version I believe that's exactly what I did:
A call to test_util:config_files() pulls in random_port.ini, which sets [httpd] port = 0
Though that should also depend on setting the port to 0 in the config file, which, near as I can tell, you only do for the http proxy tests. Did you mean to add a third ini file to override that in test_utils:config_files()?
Ah, yeah, that's mochiweb_socket_server:get(couch_httpd, port), which relies on a cached result of inet:port(Socket) underneath.
Heh, no biggy. When I saw your comment about the extra patch I thought you meant take a peek. I'm sure its fine I was mostly just curious to see how you fixed the random port generation.
Oh, whoops! Missed your message Paul. I figured this one didn't need too much review since it's only touching test code. By the way, this link gives a decent compare:
since it uses apache:trunk as the default. I don't know why rnewson's patch is on there, probably because it's picked from his git branch instead of the git-svn version.
That's one way to get a compare view. XD
Unit tests fire up a couch on a random port now.
Can i get a compare view link for that branch?
Looks like you haven't pushed to trunk in awhile.
Added another patch. Now the server always listens on an unused port during the etap unit tests, so there's no chance of eaddrinuse collisions with other instances of CouchDB.
Updated the branch with a patch that runs the _test resource on a random port and tries to connect to an IANA reserved port for the _error resource.
Here's a patch:
The only limitation is that 180-http-proxy.t will fail if something is running on 5985 or 5986.