> > ``` > > if (conn->addr == NULL && conn->naddr != 0) > > ```
Afaict this is not necessary, since getaddrinfo already returns an error if the host could not be resolved to any addresses. A quick test gives me this error: error: could not translate host name "doesnotexist" to address: Name or service not known > > ``` > + } > + else > + conn->load_balance_type = LOAD_BALANCE_DISABLE; > ``` > > The else branch is never executed. I don't think that line is coverable then. There's definitely places in the test suite where load_balance_hosts is not explicitly set. But even in those cases I guess the argument parsing logic will use DefaultLoadBalanceHosts instead of NULL as a value for conn->load_balance_type. > Strangely enough the body of the for loop is never executed either. > Apparently only one address is used and there is nothing to shuffle? > > Here is the exact command I used to build the code coverage report: I guess you didn't set up the hostnames in /etc/hosts as described in 004_load_balance_dns.pl. Then it's expected that the loop body isn't covered. As discussed upthread, running this test manually is much more cumbersome than is desirable, but it's still better than not having the test at all, because it is run in CI.