]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-client-errors: Make "peer reuse failure" test reliable.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Mon, 13 Aug 2018 17:23:31 +0000 (19:23 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 13 Nov 2018 11:21:21 +0000 (13:21 +0200)
It was highly timing-sensitive, since it required a particular error status to
be returned. Sometimes, it would yield a different error based on a
slightly different order of events, making the test fail. Such failures aren't
relevant though, since this regression test is about triggering a segfault that
used to occur.

src/lib-http/test-http-client-errors.c

index 1b8d80c4183fde6420f7f661bd92f1848b79f04c..225cbb45b1dc785397bb8e4ba9045e77338c3f9d 100644 (file)
@@ -2665,7 +2665,7 @@ test_client_peer_reuse_failure_response2(
        if (debug)
                i_debug("RESPONSE: %u %s", resp->status, resp->reason);
 
-       test_assert(resp->status == HTTP_CLIENT_REQUEST_ERROR_CONNECT_FAILED);
+       test_assert((resp->status / 100) > 2);
        test_assert(resp->reason != NULL && *resp->reason != '\0');
        i_free(ctx);
        io_loop_stop(ioloop);