2

I am trying to upgrade Karate from version 0.9.6 to 1.0.0 and started to have some issues with the new JS engine.

01: karate.callSingle('classpath:commons/product/CreateProductTestDataForCurrentTenant.feature')
<<<<
org.graalvm.polyglot.PolyglotException: Multi threaded access requested by thread Thread[pool-1-thread-4,5,main] but is not allowed for language(s) js.
- com.oracle.truffle.polyglot.PolyglotEngineException.illegalState(PolyglotEngineException.java:132)
- com.oracle.truffle.polyglot.PolyglotContextImpl.throwDeniedThreadAccess(PolyglotContextImpl.java:727)
- com.oracle.truffle.polyglot.PolyglotContextImpl.checkAllThreadAccesses(PolyglotContextImpl.java:627)
- com.oracle.truffle.polyglot.PolyglotContextImpl.enterThreadChanged(PolyglotContextImpl.java:526)
- com.oracle.truffle.polyglot.PolyglotEngineImpl.enter(PolyglotEngineImpl.java:1857)
- com.oracle.truffle.polyglot.HostToGuestRootNode.execute(HostToGuestRootNode.java:104)
- org.graalvm.polyglot.Value.canExecute(Value.java:434)

This works with version 0.9.6

Is some additional config missing to making it work? I could not find any mention to it in the upgrade guide.

aleruz
  • 133
  • 5

1 Answers1

0

This is quite likely a bug - and an edge case we had concerns about. We've got one report so far here: https://github.com/intuit/karate/issues/1515#issuecomment-799145191

So it would be tremendously helpful if you can provide a way to replicate, following this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue

One recommendation is do not return JS functions in the results of callSingle() try to stick to "pure" data or JSON.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • The feature itself is calling some other sub-features which do some API calls and they return their response. So, for my understanding, JS function should be involved in the return. The call itself to the feature is something like: `* def createProductTestDataResponse = karate.callSingle('classpath:commons/product/CreateProductTestDataForCurrentTenant.feature')` – aleruz Mar 16 '21 at 10:13
  • @aleruz - ok. if you can provide a way to replicate, that'll make it a lot faster for us to pin this down, that's all. since we already spent time in this area and thought we had resolved all the "common" cases. you'll probably have to remain on 0.9.6 for a while else – Peter Thomas Mar 16 '21 at 10:30
  • I understand your point, and will try to investigate further and try to reproduce it in a "clean" environment. I am far from complaining, to be clear ;-) I am trying to explain my use case to help for the upgrade and to help finding issues. Try to replicate it in a clean project could take me some time, so if you need further information on how the test is built, just ask. – aleruz Mar 16 '21 at 10:34
  • @aleruz sorry I've had too much oss for the week :) so I've made this commit and tried to mix a callSingle + an HTTP call into one our tests that should be a nice reference for you to compare and suggest what to add and maybe you can clone locally and test: https://github.com/intuit/karate/commit/89f68168a43343975ce5d986811ba1d814d39b1d - we can move the discussion to that ticket https://github.com/intuit/karate/issues/1515 – Peter Thomas Mar 16 '21 at 10:56