Hello! Any update on this issue? I am receiving the same error in a script where I am waiting for 2 minutes (purposefully) at the end of my test script. Is there a request timeout setting in postman that I need to change?
The test script is perfectly fine and doesn’t seem to error out.
pm.test("Status code is 200", function() {
pm.response.to.have.status(200);
});
The error - Error: sandbox: execution interrupted, bridge disconnecting , generally happens when there’s a part of the script that is non-terminating or has some memory overflow issue around it.
For eg, there might be some infinitely running while/for loop.
To debug, you can comment all the parts of your script and just run this test to see if it works or not, and then you can drill down to the line which might be causing this issue.
Hello @singhsivcan! Thanks for the response. If I remove the following few lines, I the script runs just fine. To be clear, the request still executes but the response throws the error.
console.log(“Sleep for 3 minutes to let video transcode”);
var t = new Date().getTime();
while (new Date().getTime() < t + 180000);
console.log(“Done sleeping”);
This was working 2 days ago. Is there a different way that I can sleep after this request?
@chrisallemang - I am not sure why it was working before, but I do know that a synchronous operations will end after 30 seconds (That is the internal limit).
So, instead of going with the synchronous approach to halt the script you can go with the asynchronous way to halt the script using setTimeout for a much larger amount of time.
For eg:
setTimeout(() => {
// Write your logic here
pm.test('This test will pass after 20 seconds');
}, 20000);