最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

karate - How to work around the Multi threaded access request ... is not allowed for language(s) js? - Stack Overflow

programmeradmin3浏览0评论

I've read Multi threaded access requested by thread Thread[pool-2-thread-1,5,main] but is not allowed for language(s) js and Karate - Multi threaded access requested - issue (which says this was fixed in karate 1.1.0.RC2. I'm using karate 1.5.1 and am getting this error traced to the following line:

* call read('classpath:lib/NuxeoClient.feature@AddDocVersion') {docId: '#(baseCntntIdNum)', filePath: '#(testFiles.testv2pdf.path)'}

I'd like to find the offending javascript, so I can try to remove/replace it and be able to run multi-threaded successfully. But, I'm not sure how to find the offending javascript. The above called Scenario doesn't call any js functions.

It does include a line like this:

* def iso8601String = instant.replace(/...Z$/, 'Z')

and it does call other features that have lines like these:

 * if ( __arg.filePath ) karate.call('classpath:lib/NuxeoClient.feature@UploadFileToBatch', {filePath: __arg.filePath})

and

* def fullQuery = __arg.version ? baseQuery + " AND base:version_id = " + __arg.version : baseQuery + "ORDER BY base:version_id DESC"

Do any of these constitute javascript that would cause the multi-threaded processing to fail?

I've read Multi threaded access requested by thread Thread[pool-2-thread-1,5,main] but is not allowed for language(s) js and Karate - Multi threaded access requested - issue (which says this was fixed in karate 1.1.0.RC2. I'm using karate 1.5.1 and am getting this error traced to the following line:

* call read('classpath:lib/NuxeoClient.feature@AddDocVersion') {docId: '#(baseCntntIdNum)', filePath: '#(testFiles.testv2pdf.path)'}

I'd like to find the offending javascript, so I can try to remove/replace it and be able to run multi-threaded successfully. But, I'm not sure how to find the offending javascript. The above called Scenario doesn't call any js functions.

It does include a line like this:

* def iso8601String = instant.replace(/...Z$/, 'Z')

and it does call other features that have lines like these:

 * if ( __arg.filePath ) karate.call('classpath:lib/NuxeoClient.feature@UploadFileToBatch', {filePath: __arg.filePath})

and

* def fullQuery = __arg.version ? baseQuery + " AND base:version_id = " + __arg.version : baseQuery + "ORDER BY base:version_id DESC"

Do any of these constitute javascript that would cause the multi-threaded processing to fail?

Share Improve this question asked Mar 10 at 19:11 Jon DetertJon Detert 931 silver badge9 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Yes, unfortunately read() could be problem and I think replace() also, these are JS function calls which are the most troublesome. And if they call other features, the surface area increases etc.

I suggest a step by step approach where you can remove pieces of code and see what works. FYI, we have a long term fix for this, it should land by mid-2025: https://github/karatelabs/karate-js

发布评论

评论列表(0)

  1. 暂无评论