fix: python后置脚本执行失败导致获取不到结果

This commit is contained in:
chenjianxing 2021-05-26 14:07:08 +08:00 committed by jianxing
parent 6e68f86553
commit e5d249feaa
1 changed files with 7 additions and 2 deletions

View File

@ -234,8 +234,13 @@ public abstract class JSR223TestElement extends ScriptingTestElement
synchronized (compiledScriptsCache) {
compiledScript = compiledScriptsCache.get(this.scriptMd5);
if (compiledScript == null) {
compiledScript = ((Compilable) scriptEngine).compile(getScript());
compiledScriptsCache.put(this.scriptMd5, compiledScript);
try {
compiledScript = ((Compilable) scriptEngine).compile(getScript());
compiledScriptsCache.put(this.scriptMd5, compiledScript);
} catch (IllegalArgumentException e) {
LogUtil.error(e.getMessage(), e);
return new Object();
}
}
}
}