Newman Version (can be found via newman -v): 4.2.2-alpine
OS details (type, version, and architecture): Centos x86 7.6.1810
Are you using Newman as a library, or via the CLI?: Via docker container
3a. Did you encounter this recently, or has this bug always been there:
Recently. CI driven test runs were stable (Ran every 5 minutes for a week without issue)
Now persistently and randomly unstable between runs.
Expected behaviour:
All tests pass
Command / script used to run Newman:
docker run --rm --volume="${PWD}":/etc/postman -t
docker run --rm --volume="${PWD}":/etc/postman -t
Sample collection, and auxiliary files (minus the sensitive details):
Can't provide these unfortunately. However, the tests are all very simple and of the form:
Request: GET
pm.test("title"), function() {
pm.response.to.have.status(401);
});
pm.test("title"), function() {
pm.expect(pm.response.responseTime).to.be.below(200);
});
I have 113 tests between the two collections, and different tests fail randomly between runs.
Jenkins reports:
62 failures out of 133
45 failures out of 129
21 failures out of 122
Note: The number of tests has not changed between runs, so there is an issue with the junit XML generation - see Scenario 1 below.
Several scenarios seen:
1 - dns failure)
Always seen in:
Iteration: 0
RequestError: Error: getaddrinfo ENOTFOUND
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
The number of these *
For cases where 1 occurs then the child tests will all fail with either scenario 2 or scenario 3 below:
2 - response UNDEFINED)
Failed 1 times.
Collection JSON ID:
Collection name:
Request name:
Test description: Response must be valid and have a body
Error message: expected response to have status reason 'OK' but got 'UNDEFINED'.
Stacktrace: AssertionError: expected response to have status reason 'OK' but got 'UNDEFINED' at Object.eval sandbox-script.js:1:3).
3 - response time undefined)
Failed 1 times.
Collection JSON ID:
Collection name:
Request name:
Test description: Response time is less than 200ms.
Error message: expected undefined to be a number or a date.
Stacktrace: AssertionError: expected undefined to be a number or a date at Object.eval sandbox-script.js:2:3).
Issue found to be due to rogue entries in my /etc/resolv.conf file
@codenirvana - maybe a debug mode in future that outputs where the DNS was resolved from. 馃槢馃槢
Most helpful comment
@codenirvana - maybe a debug mode in future that outputs where the DNS was resolved from. 馃槢馃槢