Closed gavl-cdl closed 3 years ago
If I amend the background step in the callers to to use callonce
:
Background:
* def functions = callonce read('classpath:/examples/utils/shared.feature')
Then I get the same The value 'DynamicObject<JSFunction>@2b9f4737' cannot be passed from one context to another
error mentioned in https://github.com/intuit/karate/issues/1515#issuecomment-803596320
@gavl-cdl thanks for the repro, yes we would like to solve this and #1515 asap
Isn't maybe the trailing /
wrong to specify a classpath? This seems more a classpath resolving issue. The thing is that now all the errors start with the org.graalvm.polyglot.PolyglotException
which could actually be misleading.
@aleruz great, since I am going to take time to get to this - do consider submitting a PR for misleading error messages
Isn't maybe the trailing / wrong to specify a classpath?
It possibly is wrong, but I would argue that the tests should either all pass or all fail (because they're basically the same) rather than giving a mix of pass/fail for the same "Background" step.
This problem does occur in our very-not-minimal test pack without the slash, but I've not been able to reproduce it (yet) in this minimal case without it (I'll keep trying) - my hunch is that the slash slows something down or trips something up just enough to make cross-thread interference more likely.
Re-running our very-fat "real" test pack, I found a similar stack processing the thymeleaf templates (see the "caused by"):
karate.org.thymeleaf.exceptions.TemplateProcessingException: Error during execution of processor 'karate.org.thymeleaf.standard.processor.StandardReplaceTagProcessor' (template: "karate-feature.html" - line 27, col 14)
at karate.org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:117)
at karate.org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95)
at karate.org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)
at karate.org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314)
at karate.org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205)
at karate.org.thymeleaf.engine.TemplateModel.process(TemplateModel.java:136)
at karate.org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:661)
at com.intuit.karate.template.KarateTemplateEngine.process(KarateTemplateEngine.java:90)
[snip]
Caused by: java.lang.RuntimeException: not found: com/intuit/karate/report/karate-leftnav.html
at com.intuit.karate.resource.ResourceUtils.getResource(ResourceUtils.java:118)
at com.intuit.karate.resource.ResourceResolver.get(ResourceResolver.java:70)
at com.intuit.karate.resource.ResourceResolver.resolve(ResourceResolver.java:65)
at com.intuit.karate.template.ResourceHtmlTemplateResolver.resolveTemplate(ResourceHtmlTemplateResolver.java:63)
at karate.org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:845)
[snip]
(full stack attached) template-not-found-stack.txt
@gavl-cdl that doesn't sound good at all. I hope this is a one off. if this happens a lot - I'd be worried if spring or something heavy like that is in the mix and slowing down / colliding with our shaded classgraph, see this link: https://github.com/intuit/karate/pull/1408#issue-543436487
note to self: we may have to move the report templates into some in-memory cache
@gavl-cdl okay should be fixed now. and were you in a spring-boot jar situation by any chance ? hopefully you won't see either of the problems above any more - please do build and test locally: https://github.com/intuit/karate/wiki/Developer-Guide
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!
@gavl-cdl awesome. and you may have noticed that we have #1515 sorted out as well
1.0.1 released
Am using karate 1.1.0 I am grouping my feature files into multiple folders but when am trying to call one feature from forlderA to FolderB then its not working out
Below is the project structure am creating for my framework
src/test/java/reusableFeatures/.feature files test1.feature
src/test/java/PagesFeatures/.feature files testpage1.feature call read('classpath:/reusableFeatures/test1.feature') #-->Same error as above
src/test/java/testcaseFeatures/.feature files testcase1.feature call read('classpath:/pagesFeatures/testpage1.feature') #--> This is failing saying org.graalvm.polyglot.PolyglotException: java.io.FileNotFoundException: C:\Users\workspace\project\KARATEUI_Project\src\test\java\testcaseFeatures\testpage1.feature(The system cannot find the file specified)
Note: I do not want to the put all feature under same folder that would work, I need to segregate the features in folder wise and make it work @ptrthomas Please help me
@DineshTejaj we can't help unless you follow this process, and we consider 1.2.0.RC2 as the latest release: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue
Thanks a lot I upgraded the new version it is working now
@DineshTejaj Hi Dinesh, I am too facing the same issues. Can you please help, what version are you using now?
@DineshTejaj , what you have upgraded to new version? I am also facing the same issue. I am using VS code
to everyone commenting here, please try and submit a sample project following the process. it isn't too hard. I'm locking this thread now
Minimal repro: zip attached
This project contains a shared feature, which defines which defines a javascript function:
There are then three "caller" features, each containing a "Background" that calls the "shared" feature:
Each caller than has five scenarios which call the function with a parameter and assert the result.
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: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