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

Retry until issue #1662

Closed
XoNems opened this issue Jun 23, 2021 · 3 comments
Closed

Retry until issue #1662

XoNems opened this issue Jun 23, 2021 · 3 comments
Labels

Comments

@XoNems
Copy link

XoNems commented Jun 23, 2021

Hello here,

I have been using Karate since early 2019.
We use Karate to manage the non regression tests of a multi stack asynchronous datalake project.

Managing the retry is important to us.

I went from 0.96 (which was great) to 1.0.0 last Friday.
I had to make a lot of small changes but without much impact.

However I just realized a big change concerning the retry.

This call in 0.96 was viable:

And retry until responseStatus == 200 && response.lastMeasures [2!] = []

But since 1.0.0 I have an error and my retry does not seem to work anymore

java.lang.AssertionError: >>>> js failed:
01: responseStatus == 200 && response.lastEvents [2] .type! = Null
<<<<
org.graalvm.polyglot.PolyglotException: Index 2 out of bounds for length 2

  • java.base / jdk.internal.util.Preconditions.outOfBounds (Preconditions.java:64)
  • java.base / jdk.internal.util.Preconditions.outOfBoundsCheckIndex (Preconditions.java:70)
  • java.base / jdk.internal.util.Preconditions.checkIndex (Preconditions.java:248)
  • java.base / java.util.Objects.checkIndex (Objects.java:372)
  • java.base / java.util.ArrayList.get (ArrayList.java:459)
  • com.intuit.karate.graal.JsList.get (JsList.java:60)
  • com.oracle.truffle.polyglot.HostToGuestCodeCache $ 6.boundaryGet (HostToGuestCodeCache.java:160)

I tried to find something on the internet but was unsuccessful, do you have a lead? Thank you in advance !

Regard

@ptrthomas
Copy link
Member

@XoNems please follow this process and we will investigate. but you HAVE to follow the process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

@XoNems
Copy link
Author

XoNems commented Jul 1, 2021

Hello,

I understand the process. However my reproduction case will not be so easy from a public API.

It's pretty straightforward.

In 0.96:
Retry until response.tab [5]! = Null was a valid retry.
Since 1.0.0 this is no longer the case.
I have 1300 HTTP call in get to be modified at the unit to seek a solution to all this.

In 1.0.0:
When the condition is not present then the retry works but when the data is there and the message is 'condition satisfied' then I have an unrealized exception

Here are the console logs
[main] WARN com.intuit.karate - retry condition evaluation failed: >>>> js failed: ( org.graalvm.polyglot.PolyglotException: Index 0 out of bounds for length 0 )
[main] DEBUG com.intuit.karate - retry condition not satisfied: response.data[0] != []
[main] DEBUG com.intuit.karate - retry condition not satisfied: response.data[0] != []
[main] DEBUG com.intuit.karate - sleeping before retry #1
[main] DEBUG com.intuit.karate - retry condition satisfied
[main] ERROR com.intuit.karate - src/test/java/test.feature:297
When method GET

js failed:
01: response.data[0] != []

Regard

@ptrthomas
Copy link
Member

@XoNems not reading the above.

not be so easy from a public API.

that's exactly what mocks are for. if this issue is important to you, you have to find the time. refer this example if needed: #1645 (comment)

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

No branches or pull requests

2 participants