question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Version 1.7.0 Breaks Boolean Capture

See original GitHub issue

I have this step that uses the artillery expect plugin and passes in version 1.6.2, but fails in 1.7.0.

- post:
        url: '/verify/reset?email=success@simulator.amazonses.com'
        headers:
          password: 5f4dcc3b5aa765d61d8327deb882cf99
        auth:
          user: application
          pass: secret
        capture:
          - json: $.email.address
            as: email
          - json: $.email.verified
            as: verified
        expect:
          - statusCode: 200
          - hasProperty: creationTime
          - hasProperty: lastUpdateTime
          - equals:
              - "{{ email }}"
              - "success@simulator.amazonses.com"
          - equals:
              - "{{ verified }}"
              - false

It’s failing with this error:

not ok equals true, false
  expected: all values to be equal
       got: true, false
  Request params:
    http://localhost:8080/verify/reset?email=success@simulator.amazonses.com
    ""
  Headers:
   date : Wed, 12 May 2021 22:33:46 GMT
   content-type : application/json
   content-length : 254
  Body:
    "{\"email\":{\"address\":\"success@simulator.amazonses.com\",\"verified\":false,\"verificationToken\":null},\"password\":\"5f4dcc3b5aa765d61d8327deb882cf99\",\"attributes\":[\"hello\",\"world\"],\"creationTime\":1620858825642,\"uniqueID\":\"ABC123\",\"lastUpdateTime\":1620858826475}"
  User variables:
     target : http://localhost:8080
     $environment : undefined
     testMetrics : false
     $uuid : ccc8885d-e7d1-4038-b533-1b1f83083dcb
     email : success@simulator.amazonses.com
     creationOriginal : 1620858825642
     errorString : Unable to validate user with provided credentials. (User: success@simulator.amazonses.com)
     creationGet : 1620858825642
     verificationToken : c7bebcfc-89cd-4a98-91bb-343587572a8e
     verified : true

It looks like the capture here is not working correctly:

- json: $.email.verified
  as: verified

Because the JSON body has verified set to false, but artillery thinks it is set to true.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
mkadirtancommented, May 22, 2021

#1040 seems related

2reactions
hassycommented, May 21, 2021

Ah, I think this line may be the problem:

https://github.com/artilleryio/artillery/blame/v1.6.x/core/lib/engine_util.js#L345 (changed between 1.6 and 1.7)

Because v.value is false (set correctly), the very first check returns true and isCaptureFailed() returns true. Checking that typeof v.value === 'undefined' instead of !v.value should fix it.

If you have a bit of time to test that & package the fix up as a PR that would be awesome. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

What's new in Kotlin 1.7.0
Here is a list of the major updates in this version: The new Kotlin K2 compiler is in Alpha now, and it offers...
Read more >
Activity - Android Developers
Version 1.7.0 -alpha02 contains these commits. Bug Fixes ... The new CaptureVideo ActivityResultContract returns a boolean to your ...
Read more >
kotlin/ChangeLog.md at master · JetBrains/kotlin - GitHub
MyClass' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler" but builds fine; KT-47203...
Read more >
Check if null Boolean is true results in exception
When you have a boolean it can be either true or false . Yet when you have a Boolean it can be either...
Read more >
Changelog | Burst | 1.7.4 - Unity - Manual
One Definition Rule optimisation would break if multiple modules shared static ... Upgraded Burst to use LLVM Version 12.0.0 by default, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found