Successful individual tests fail as a complete suite

I have a test suite consisting of 75 “get” calls. If I run the tests individually they work, although some take a long time (about 3 or 4 minutes). If I run the entire test suite at once, Postman crashes on the fourth test, which is the one that returns the highest values. If I run the entire test suite from the command line using newman, it fails on the fourth test, returning the error:

Fatal error in , line 0
# Fatal JavaScript invalid size error 169220804 (see crbug.com/1201626)
#
#
#
#FailureMessage Object: 00000069B8BFC810
----- Native stack trace -----

 1: 00007FF7EBB171AB node::SetCppgcReference+16075
 2: 00007FF7EBA1649F node::TriggerNodeReport+70223
 3: 00007FF7EC8E2E72 V8_Fatal+162
 4: 00007FF7EC37A0D5 v8::Platform::SystemClockTimeMillis+855861
 5: 00007FF7EC219F46 v8::Message::GetIsolate+16294
 6: 00007FF7EC03B983 v8::CodeEvent::GetFunctionName+181699
 7: 00007FF78C55AAFA

The 75 Get calls all run the same test, but apply it to 75 different services; the test is packaged into a package that is called in each Get script:

function Status_200() {
    pm.test("Status test", function () {
        if (pm.response.code === 200) {
        console.log("Status is OK");
    } else {
        throw new Error(`Expected status 200 but got ${pm.response.code}`);
    }
 });
}

// Call the test function
Status_200();

// Export the function to be used in other modules
module.exports = {
    Status_200
};

If I run the entire suite using the Postman application, execution stops at the fourth test with the error: RangeError: Invalid array length.

If I run only the fourth test, it finishes successfully.

1 Like

Hey @science-geoscienti11,
This is definitely a weird one. However, for a first look, I’d recommend going to the application settings and adjust the max response size to 0 (default is 50 MB. 0 is unlimited)

An extra list of measures to apply for your collection run settings would include:

  • Check Turn off logs during run. Just in case logs are being buffered and very large responses are returned (logging should be async and shouldn’t break the main thread but you never know)
  • Uncheck Stop run if an error occurs. Just to see how the entire test suite will behave.
  • Make sure persist responses for a session is unchecked. Large responses may cause session buffer to overflow.

Update: I also found an open issue on Gihub for it RangeError: Invalid array length, with large files and post-response tests · Issue #13086 · postmanlabs/postman-app-support · GitHub

Hope this helps solve your issue :pray:

Hi @houssem-gharssallah thanks a lot for the reply, but my settings on Postman were already like this and it doesn’t work…

1 Like