CouchDB
  1. CouchDB
  2. COUCHDB-1049

Etap tests should not require port 5984

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.3, 1.1
    • Component/s: None
    • Labels:
      None

      Description

      In fact, perhaps they should run somewhere else by default.

        Activity

        Hide
        Paul Joseph Davis added a comment -

        Moar trickery!

        LGTM

        Show
        Paul Joseph Davis added a comment - Moar trickery! LGTM
        Hide
        Adam Kocoloski added a comment -

        Yep, in the final version I believe that's exactly what I did:

        http://svn.apache.org/viewvc/couchdb/trunk/test/etap/test_util.erl.in?r1=1066574&r2=1066573&pathrev=1066574

        A call to test_util:config_files() pulls in random_port.ini, which sets [httpd] port = 0

        Show
        Adam Kocoloski added a comment - Yep, in the final version I believe that's exactly what I did: http://svn.apache.org/viewvc/couchdb/trunk/test/etap/test_util.erl.in?r1=1066574&r2=1066573&pathrev=1066574 A call to test_util:config_files() pulls in random_port.ini, which sets [httpd] port = 0
        Hide
        Paul Joseph Davis added a comment -

        Trickery!

        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()?

        Show
        Paul Joseph Davis added a comment - Trickery! 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()?
        Hide
        Adam Kocoloski added a comment -

        Ah, yeah, that's mochiweb_socket_server:get(couch_httpd, port), which relies on a cached result of inet:port(Socket) underneath.

        Show
        Adam Kocoloski added a comment - Ah, yeah, that's mochiweb_socket_server:get(couch_httpd, port), which relies on a cached result of inet:port(Socket) underneath.
        Hide
        Paul Joseph Davis added a comment -

        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.

        Show
        Paul Joseph Davis added a comment - 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.
        Hide
        Adam Kocoloski added a comment -

        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:

        https://github.com/kocolosk/couchdb/compare/1049-etap-httpd-ports

        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.

        Show
        Adam Kocoloski added a comment - 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: https://github.com/kocolosk/couchdb/compare/1049-etap-httpd-ports 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.
        Hide
        Paul Joseph Davis added a comment -

        That's one way to get a compare view. XD

        Show
        Paul Joseph Davis added a comment - That's one way to get a compare view. XD
        Hide
        Adam Kocoloski added a comment -

        Unit tests fire up a couch on a random port now.

        Show
        Adam Kocoloski added a comment - Unit tests fire up a couch on a random port now.
        Hide
        Paul Joseph Davis added a comment -

        Can i get a compare view link for that branch?

        https://github.com/kocolosk/couchdb/compare/trunk...1049-etap-httpd-ports

        Looks like you haven't pushed to trunk in awhile.

        Show
        Paul Joseph Davis added a comment - Can i get a compare view link for that branch? https://github.com/kocolosk/couchdb/compare/trunk...1049-etap-httpd-ports Looks like you haven't pushed to trunk in awhile.
        Hide
        Adam Kocoloski added a comment -

        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.

        Show
        Adam Kocoloski added a comment - 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.
        Hide
        Adam Kocoloski added a comment -

        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.

        Show
        Adam Kocoloski added a comment - 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.
        Hide
        Adam Kocoloski added a comment -

        Here's a patch:

        https://github.com/kocolosk/couchdb/tree/1049-etap-httpd-ports

        The only limitation is that 180-http-proxy.t will fail if something is running on 5985 or 5986.

        Show
        Adam Kocoloski added a comment - Here's a patch: https://github.com/kocolosk/couchdb/tree/1049-etap-httpd-ports The only limitation is that 180-http-proxy.t will fail if something is running on 5985 or 5986.

          People

          • Assignee:
            Adam Kocoloski
            Reporter:
            Adam Kocoloski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development