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

fix(http): prevent multiple callbacks when a capture/match fails #1544

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

hassy
Copy link
Member

@hassy hassy commented Jul 28, 2022

Fixes #1542

We need to be consistent with only emitting from step, otherwise we risk emitting the same error more than once
@hassy hassy merged commit d099cbd into master Jul 29, 2022
@hassy hassy deleted the fix/http-multiple-callbacks branch July 29, 2022 13:00
@meetveera
Copy link

meetveera commented Aug 1, 2022

Hi @hassy - Good Morning. Thank you very much for fixing the problem. Now I am getting proper status codes for multiple redirects errors.
But again for some APIs it is still going on infinite loop. I double checked my API by executing it via postman and it is working fine there. When I did a little more digging and commented the below line from the snippet from my local machine that all my APIs started to work absolutely fine.

            // TODO: Handle the error properly with run hooks
            ee.emit('error', gotErr.code || gotErr.message);
           // return callback(gotErr, context); line 702 from engine_http.js
 });

Could you please take a look and see what exactly the problem is? I might be wrong but again commenting that line just worked for me and now all my apis are working fine via artillery run.

Thanks

@hassy
Copy link
Member Author

hassy commented Aug 19, 2022

@meetveera could you try the most recent release of Artillery to see if it fixes the issue.

@onematchfox
Copy link

@meetveera could you try the most recent release of Artillery to see if it fixes the issue.

Hi @hassy,

I'm also running into this issue - in the latest version 2.0.0-23. In my case it presents when looping over requests that are set to expect a specific status code (in one case a 403 and in another a 302). E.g.

- loop:
    - get:
        url: '/foo?bar={{ $loopElement }}'
        followRedirect: false
        expect:
          - statusCode: 302
  over: myVariable
- loop:
    - get:
        url: '/{{ $loopElement }}'
        expect:
          - statusCode: 403
  over: myVariable

Let me know if I should open a separate issue for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Artillery going in infinite loop with "Callback was already called" error
3 participants