Skip to content
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

setVar inside tests from requests that is run from another request's (parent request) pre-run results in the parent request's getVar getting outdated value #1550

Open
oopchi opened this issue May 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@oopchi
Copy link

oopchi commented May 27, 2024

Describe the bug
setVar inside tests from requests that is run from another request's (parent request) pre-run results in the parent request's getVar getting outdated value. For example:

  1. Run request A
  2. Request A's pre-run gets called
  3. Request A's pre-run call await tc.runRequest(request B)
  4. Request B gets called
  5. Request B's test scripts get called
  6. Request B's test scripts contains tc.setVar("existing-key", "updated-value");
  7. Request B's test ended
  8. Request A's pre-run resume from point 3
  9. Request A's pre-run calls tc.getVar("key-from-point-6");
  10. Request A's pre-run gets "old-value" instead of "updated-value"

To Reproduce

  1. Run request A
  2. Request A's pre-run gets called
  3. Request A's pre-run call await tc.runRequest(request B)
  4. Request B gets called
  5. Request B's test scripts get called
  6. Request B's test scripts contains tc.setVar("existing-key", "updated-value");
  7. Request B's test ended
  8. Request A's pre-run resume from point 3
  9. Request A's pre-run calls tc.getVar("key-from-point-6");
  10. Request A's pre-run gets "old-value" instead of "updated-value"

Expected behavior
getVar should return the updated value instead of the old value of the requested variable after being updated from a child-request's test functions.

Platform:

  • OS: Windows 11
  • vscode version: v1.89.1
  • node version: v20.8.0
  • extension version: v2.23.9

Are you using the free version/paid version/trial:
free version

@oopchi oopchi added the bug Something isn't working label May 27, 2024
@rangav
Copy link
Collaborator

rangav commented May 27, 2024

@oopchi thanks for reporting, will look into it.

tc.runRequest will be a paid feature from June 3rd.
https://github.com/thunderclient/thunder-client-support/releases/tag/v2.24.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants