You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After converting standard-assets to esm I came across a bug when running tests related to the routed_sender operation. The two problematic tests files are listed here:
The test will fail when the test harness gets initialized and starts importing all the necessary operations for the job. Depending on what node version you're running you could get two variations of the error.
node 18.19.1:
_err: Error: request for '@terascope/utils' is not yet fulfilled
at SourceTextModule.link (node:internal/vm/module:200:17)
at Runtime.linkAndEvaluateModule (/Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/jest-runtime/build/index.js:708:5)
at importModuleDynamicallyWrapper (node:internal/vm/module:429:15)
at OperationLoader.require (/Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/@terascope/job-components/src/operation-loader/loader.ts:347:18)
at OperationLoader.loadProcessor (/Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/@terascope/job-components/src/operation-loader/loader.ts:153:23)
at /Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/@terascope/job-components/src/job-validator.ts:66:17
at /Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/p-map/index.js:57:22 {
code: 'ERR_VM_MODULE_LINK_FAILURE'
}
node 22.2.0:
_err: Error: request for '@terascope/utils' is not in cache
at SourceTextModule.link (node:internal/vm/module:204:17)
at Runtime.linkAndEvaluateModule (/Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/jest-runtime/build/index.js:708:5)
at importModuleDynamicallyWrapper (node:internal/vm/module:436:15)
at OperationLoader.require (/Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/@terascope/job-components/src/operation-loader/loader.ts:348:23)
at OperationLoader.loadProcessor (/Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/@terascope/job-components/src/operation-loader/loader.ts:153:23)
at /Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/@terascope/job-components/src/job-validator.ts:66:17
at /Users/jsoto/Workspace/TerasliceAssets/standard-assets/node_modules/p-map/index.js:57:22 {
code: 'ERR_VM_MODULE_LINK_FAILURE'
}
I believe this is caused by a node vm problem with jest and node on bridging the gab with commonjs files and the esm syntax.
Here are references that led to this conclusion:
A potential fix could be to convert @terascope/utils to esm but that may or may not work.
I have a hotfix that seems to overcome this by importing the routed_sender processor.ts file at the beginning of the two test files. Although it isn't perfect, we get the benefit of still having test coverage for this operation.
To be sure things are still working, I have done some manual testing for this operation to validate its functionality. I started a k8s cluster with the following teraslice configuration:
This resulted in four separate indices in two separate elasticsearch databases. The combined total records added up to the expected total of 10,000 records.
curling es-1 indices:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open ts-dev1__ex vSHIh5BsTCmLcq5pW80XwA 5 1 5 106 264.4kb 264.4kb
yellow open ts-dev1__jobs CaWHx099SFWl2-tACZycnQ 5 1 2 3 27.6kb 27.6kb
yellow open ts-dev1__assets sIPcJ2WcTUaA0mTjmc6pBg 5 1 4 0 24.9kb 24.9kb
yellow open result-index-1 7r0DolBhSlGNcyS66lVAYQ 1 1 2575 0 2.1mb 2.1mb
yellow open ts-dev1__state-2024.06 Qn1zeMEgTS2KdgKliIE9OQ 5 1 1458 2163 918.8kb 918.8kb
yellow open result-index-0 x4Iil-EbSuiekJlClNU4yA 1 1 2506 0 2.1mb 2.1mb
yellow open ts-dev1__analytics-2024.06 gkN1mdBAQqm8kyGzw58YHQ 5 1 1344 0 324.2kb 324.2kb
curling es-2 indices:
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
yellow open result-index-3 fAVQut8pRpaIKL4AL023hw 1 1 2476 0 2.1mb 2.1mb
yellow open result-index-2 BuuBA25PRZipifwhdRVCsQ 1 1 2443 0 2mb 2mb
The text was updated successfully, but these errors were encountered:
After converting
standard-assets
to esm I came across a bug when running tests related to therouted_sender
operation. The two problematic tests files are listed here:The test will fail when the test harness gets initialized and starts importing all the necessary operations for the job. Depending on what node version you're running you could get two variations of the error.
node 18.19.1:
node 22.2.0:
I believe this is caused by a node
vm
problem with jest and node on bridging the gab with commonjs files and the esm syntax.Here are references that led to this conclusion:
request for ... is not yet fulfilled
linking error jestjs/jest#11434A potential fix could be to convert
@terascope/utils
to esm but that may or may not work.I have a hotfix that seems to overcome this by importing the
routed_sender
processor.ts file at the beginning of the two test files. Although it isn't perfect, we get the benefit of still having test coverage for this operation.To be sure things are still working, I have done some manual testing for this operation to validate its functionality. I started a k8s cluster with the following teraslice configuration:
I first created 10,000 records in an
s3
bucket running this job:Then ran a job with the routed sender that used the
hash_router
to make 4 partitions in which I can route using therouted_sender
operation:This resulted in
four
separate indices intwo
separate elasticsearch databases. The combined total records added up to the expected total of 10,000 records.curling es-1 indices:
curling es-2 indices:
The text was updated successfully, but these errors were encountered: