karate: "org.graalvm.polyglot.PolyglotException: not found" when running in parallel

Minimal repro: zip attached

This project contains a shared feature, which defines which defines a javascript function:

  Scenario: shared functions
    * def greet = function(name) { return "hello " + name; }
    * print greet

There are then three “caller” features, each containing a “Background” that calls the “shared” feature:

  Background:
    * def functions = call read('classpath:/examples/utils/shared.feature')

Each caller than has five scenarios which call the function with a parameter and assert the result.

  Scenario: call 1-1

    * def greeting = call functions.greet "test11"
    * print greeting
    * match greeting == "hello test11"
	
  [repeats]

If I use Runner.path("classpath:/examples").parallel(1); then everything passes.

But with Runner.path("classpath:/examples").parallel(5); most of the scenarios pass, but some fail at the “Background” step:

classpath:examples/features/caller3.feature:4
* def functions = call read('classpath:/examples/utils/shared.feature')
>>>> js failed:
01: read('classpath:/examples/utils/shared.feature')
<<<<
org.graalvm.polyglot.PolyglotException: not found: /examples/utils/shared.feature
- com.intuit.karate.resource.ResourceUtils.getResource(ResourceUtils.java:118)
- com.intuit.karate.core.ScenarioFileReader.toResource(ScenarioFileReader.java:128)
- com.intuit.karate.core.ScenarioFileReader.readFile(ScenarioFileReader.java:63)
- com.intuit.karate.core.ScenarioEngine.lambda$new$0(ScenarioEngine.java:118)
- <js>.:program(Unnamed:1) 

I’m on: Karate 1.0.0 (this works on 0.9.6) Windows 10 Version 2004 19041.804 Java 11.0.9 (Oracle Corporation 11.0.9+7-LTS)

Gradle version 6.3 (though our very-not-minimal “real” project is using gradle wrapper 6.8.3 and has the same problem)

I run this with the command gradle build

This feels close enough to https://github.com/intuit/karate/issues/1515 to make me suspect they may be related, but the Exception and stack don’t match.

karate-parallel.zip

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Yes, the full-fat “real” test pack has spring-boot in play.

I think I followed the local build steps correctly, and everything seems to pass (both the minimal-repro test included above, and our “real” test pack) with the development version. Thanks!