Skip to content

Commit 391e4c7

Browse files
committed
hopefully this resolves #1558 for good
1 parent c78620b commit 391e4c7

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

karate-core/src/main/java/com/intuit/karate/core/ScenarioEngine.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -1930,10 +1930,12 @@ public Variable call(Variable called, Variable arg, boolean sharedScope) {
19301930
case JAVA_FUNCTION:
19311931
return arg == null ? executeFunction(called) : executeFunction(called, new Object[]{arg.getValue()});
19321932
case FEATURE:
1933-
// will be always a map or a list of maps (loop call result)
1933+
// will be always a map or a list of maps (loop call result)
19341934
Object callResult = callFeature(called.getValue(), arg, -1, sharedScope);
1935-
recurseAndAttach(callResult);
1936-
return new Variable(callResult);
1935+
synchronized (runtime.featureRuntime.suite) { // make sure any artifacts from a callonce / callsingle are handled
1936+
recurseAndAttach(callResult);
1937+
return new Variable(callResult);
1938+
}
19371939
default:
19381940
throw new RuntimeException("not a callable feature or js function: " + called);
19391941
}

karate-core/src/test/java/com/intuit/karate/core/parallel/parallel-outline-1.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Background:
77
* def data = [ { name: 'value1' }, { name: 'value2' }, { name: 'value3' }, { name: 'value4' } ]
88
# java object that comes from a callSingle in the config
99
* def helloClass = HelloConfigSingle
10-
* callonce read('call-once-from-feature.feature')
10+
* callonce read('call-once-from-feature.feature')
1111

1212
Scenario Outline:
13-
# * call read('called.feature')
13+
* call read('called.feature')
1414
* match functionFromKarateBase() == 'fromKarateBase'
1515
* path 'fromfeature'
1616
* method get

0 commit comments

Comments
 (0)