-
Notifications
You must be signed in to change notification settings - Fork 837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pm.sendRequest is not working in promise.then() chain #5606
Comments
@timmy8526 I had the same issue and solved it by leaving an open timeout while processing the async code. Here is my solution. |
For information, this bug looks similar to issue #4131 and https://community.getpostman.com/t/using-native-javascript-promises-in-postman/636/5. If confirmed, this is a known issue. @felipeplets do you know why your workaround works ? This |
@pomeh I don't know exactly why it works, but I imagine that the timeout make the session stay open while Promise and Async/Await is not doing that. |
Note for future reference: @codenirvana we need to migrate to async_hooks from our current timerz implementation in postman-sandbox. That should open support for all language async features. Currently only setTimeout and setInterval are supported. |
Any update in 2021? |
Still having this issue in newman 5.2.1 |
Describe the bug
I wrote a function to wait for my async API to be done first and execute related tests later.
something like below:
test result ==>
"Test B" is gone somehow.
Then I checked the console output, the request has never been sent, it seems like the pm.sendRequest is not working in promise.then(). Could anyone help? Any workaround?
Expected behavior
pm.sendRequest shall be working fine in promise.then()
App information (please complete the following information):
Additional Tests
Tested with promise.then chain, it's also not working.
test result ==>
The text was updated successfully, but these errors were encountered: