We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hey there. I'm using this version:
k6 v0.47.0 (go1.20.13, linux/amd64) Extensions: github.com/gjergjsheldija/xk6-mllp (devel), k6/x/mllp [js]
And running a simple test through docker with:
docker run --volume "$(pwd)/examples":/test --workdir "/test" -i k6local:latest run /test/test.js
I edited the test.js script according to my needs (mostly adding my server url):
import {Hl7} from 'k6/x/mllp'; import {sleep} from 'k6'; const config = { host: '192.168.0.59', port: '5107' } const client = new Hl7(config); export const options = { vus: 2, duration: '1s', }; export default function () { client.send('/test/sample.hl7'); sleep(0.5) }
My server receives one message correctly for each vu, but at the second iteration, this is the error I get:
/\ |‾‾| /‾‾/ /‾‾/ /\ / \ | |/ / / / / \/ \ | ( / ‾‾\ / \ | |\ \ | (‾) | / __________ \ |__| \__\ \_____/ .io execution: local script: /test/test.js output: - scenarios: (100.00%) 1 scenario, 2 max VUs, 31s max duration (incl. graceful stop): * default: 2 looping VUs for 1s (gracefulStop: 30s) time="2024-04-09T12:12:24Z" level=error msg="panic: runtime error: invalid memory address or nil pointer dereference\ngoroutine 24 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngo.k6.io/k6/js/common.RunWithPanicCatching.func1()\n\tgo.k6.io/k6@v0.47.0/js/common/util.go:82 +0x1f3\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/dop251/goja.(*Runtime).runWrapped.func1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2430 +0x185\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/dop251/goja.(*vm).handleThrow(0xc000170000, {0x15742c0, 0x27c4160})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:788 +0x497\ngithub.com/dop251/goja.(*vm).try.func1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:807 +0x45\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/dop251/goja.(*vm).handleThrow(0xc000170000, {0x15742c0, 0x27c4160})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:788 +0x497\ngithub.com/dop251/goja.(*vm).runTryInner.func1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:830 +0x45\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/gjergjsheldija/xk6-mllp.(*HL7).publishMetrics(0xc000c383c0, 0x99, 0x5b)\n\tgithub.com/gjergjsheldija/xk6-mllp@v0.0.0-00010101000000-000000000000/client.go:75 +0x63\ngithub.com/gjergjsheldija/xk6-mllp.(*HL7).sendFile(0xc000c383c0, {0xc003713a50, 0x10})\n\tgithub.com/gjergjsheldija/xk6-mllp@v0.0.0-00010101000000-000000000000/client.go:64 +0x307\ngithub.com/gjergjsheldija/xk6-mllp.(*HL7).Send(0x2?, {0xc003713a50?, 0x1?})\n\tgithub.com/gjergjsheldija/xk6-mllp@v0.0.0-00010101000000-000000000000/client.go:34 +0x1e\nreflect.Value.call({0x1625880?, 0xc000c383c0?, 0x7f8fedad0288?}, {0x1783107, 0x4}, {0xc000140210, 0x1, 0x0?})\n\treflect/value.go:586 +0xb07\nreflect.Value.Call({0x1625880?, 0xc000c383c0?, 0xc002411010?}, {0xc000140210?, 0xc002430d90?, 0x0?})\n\treflect/value.go:370 +0xbc\ngithub.com/dop251/goja.(*Runtime).wrapReflectFunc.func1({{0x1a84df0, 0xc00271f950}, {0xc000b024d0, 0x1, 0x7}})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:1970 +0x3dc\ngithub.com/dop251/goja.(*nativeFuncObject).vmCall(0xc000b023c0, 0xc000170000, 0x1)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:563 +0x1af\ngithub.com/dop251/goja.call.exec(0x4?, 0xc000170000)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:3366 +0x6a\ngithub.com/dop251/goja.(*vm).run(0xc000170000)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:582 +0x62\ngithub.com/dop251/goja.(*vm).runTryInner(0xc000170000?)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:834 +0x70\ngithub.com/dop251/goja.(*baseJsFuncObject).__call(0xc000b02240, {0xc002430cf0?, 0x1, 0x1?}, {0x0?, 0x0}, {0x1a85770?, 0x2819660?})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:426 +0x705\ngithub.com/dop251/goja.(*baseJsFuncObject)._call(...)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:442\ngithub.com/dop251/goja.(*baseJsFuncObject).call(0x428f60?, {{0x1a85770, 0x2819660}, {0xc002430cf0, 0x1, 0x1}}, {0x0?, 0x0?})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:450 +0x7a\ngithub.com/dop251/goja.(*baseJsFuncObject).Call(...)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:382\ngithub.com/dop251/goja.AssertFunction.func1.1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2390 +0x77\ngithub.com/dop251/goja.(*vm).try(0xc000170000, 0xc0017d66c0)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:811 +0x244\ngithub.com/dop251/goja.(*Runtime).runWrapped(0xc0029a4800, 0x7f90150855b8?)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2434 +0x7c\ngithub.com/dop251/goja.AssertFunction.func1({0x1a85770?, 0x2819660?}, {0xc002430cf0?, 0x1?, 0x1?})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2389 +0x92\ngo.k6.io/k6/js.(*VU).runFn.func2.1()\n\tgo.k6.io/k6@v0.47.0/js/runner.go:848 +0x44\ngo.k6.io/k6/js/eventloop.(*EventLoop).Start(0xc000c38000, 0xc002735260)\n\tgo.k6.io/k6@v0.47.0/js/eventloop/eventloop.go:177 +0x1bd\ngo.k6.io/k6/js.(*VU).runFn.func2()\n\tgo.k6.io/k6@v0.47.0/js/runner.go:847 +0xea\ngo.k6.io/k6/js/common.RunWithPanicCatching({0x1a89ba0?, 0xc00059f700?}, 0x0?, 0x0?)\n\tgo.k6.io/k6@v0.47.0/js/common/util.go:86 +0x87\ngo.k6.io/k6/js.(*VU).runFn(0xc00057f180, {0x1a76be0, 0xc000c39950}, 0xa0?, 0xc0001401f8, 0xc002430cd0, {0xc002430cf0, 0x1, 0x1})\n\tgo.k6.io/k6@v0.47.0/js/runner.go:846 +0x28a\ngo.k6.io/k6/js.(*ActiveVU).RunOnce(0xc000d84300)\n\tgo.k6.io/k6@v0.47.0/js/runner.go:788 +0x4df\ngo.k6.io/k6/lib/executor.getIterationRunner.func1({0x1a76c88, 0xc002735020}, {0x1a699c0?, 0xc000d84300?})\n\tgo.k6.io/k6@v0.47.0/lib/executor/helpers.go:81 +0x64\ngo.k6.io/k6/lib/executor.ConstantVUs.Run.func5({0x1a714b0, 0xc00057f180})\n\tgo.k6.io/k6@v0.47.0/lib/executor/constant_vus.go:193 +0x32f\ncreated by go.k6.io/k6/lib/executor.ConstantVUs.Run\n\tgo.k6.io/k6@v0.47.0/lib/executor/constant_vus.go:204 +0x90e\n\nGoja stack:\n" time="2024-04-09T12:12:24Z" level=error msg="panic: runtime error: invalid memory address or nil pointer dereference\ngoroutine 23 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:24 +0x65\ngo.k6.io/k6/js/common.RunWithPanicCatching.func1()\n\tgo.k6.io/k6@v0.47.0/js/common/util.go:82 +0x1f3\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/dop251/goja.(*Runtime).runWrapped.func1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2430 +0x185\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/dop251/goja.(*vm).handleThrow(0xc0017da360, {0x15742c0, 0x27c4160})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:788 +0x497\ngithub.com/dop251/goja.(*vm).try.func1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:807 +0x45\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/dop251/goja.(*vm).handleThrow(0xc0017da360, {0x15742c0, 0x27c4160})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:788 +0x497\ngithub.com/dop251/goja.(*vm).runTryInner.func1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:830 +0x45\npanic({0x15742c0, 0x27c4160})\n\truntime/panic.go:884 +0x213\ngithub.com/gjergjsheldija/xk6-mllp.(*HL7).publishMetrics(0xc000be4e10, 0x99, 0x5b)\n\tgithub.com/gjergjsheldija/xk6-mllp@v0.0.0-00010101000000-000000000000/client.go:75 +0x63\ngithub.com/gjergjsheldija/xk6-mllp.(*HL7).sendFile(0xc000be4e10, {0xc003713a50, 0x10})\n\tgithub.com/gjergjsheldija/xk6-mllp@v0.0.0-00010101000000-000000000000/client.go:64 +0x307\ngithub.com/gjergjsheldija/xk6-mllp.(*HL7).Send(0x2?, {0xc003713a50?, 0x1?})\n\tgithub.com/gjergjsheldija/xk6-mllp@v0.0.0-00010101000000-000000000000/client.go:34 +0x1e\nreflect.Value.call({0x1625880?, 0xc000be4e10?, 0x7f8fedb10fa8?}, {0x1783107, 0x4}, {0xc0000104b0, 0x1, 0x0?})\n\treflect/value.go:586 +0xb07\nreflect.Value.Call({0x1625880?, 0xc000be4e10?, 0xc002411010?}, {0xc0000104b0?, 0xc002422390?, 0x0?})\n\treflect/value.go:370 +0xbc\ngithub.com/dop251/goja.(*Runtime).wrapReflectFunc.func1({{0x1a84df0, 0xc002719d40}, {0xc000c04110, 0x1, 0x7}})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:1970 +0x3dc\ngithub.com/dop251/goja.(*nativeFuncObject).vmCall(0xc000c04000, 0xc0017da360, 0x1)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:563 +0x1af\ngithub.com/dop251/goja.call.exec(0x4?, 0xc0017da360)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:3366 +0x6a\ngithub.com/dop251/goja.(*vm).run(0xc0017da360)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:582 +0x62\ngithub.com/dop251/goja.(*vm).runTryInner(0xc0017da360?)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:834 +0x70\ngithub.com/dop251/goja.(*baseJsFuncObject).__call(0xc0017f2240, {0xc002422340?, 0x1, 0x1?}, {0x0?, 0x0}, {0x1a85770?, 0x2819660?})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:426 +0x705\ngithub.com/dop251/goja.(*baseJsFuncObject)._call(...)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:442\ngithub.com/dop251/goja.(*baseJsFuncObject).call(0x428f60?, {{0x1a85770, 0x2819660}, {0xc002422340, 0x1, 0x1}}, {0x0?, 0x0?})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:450 +0x7a\ngithub.com/dop251/goja.(*baseJsFuncObject).Call(...)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/func.go:382\ngithub.com/dop251/goja.AssertFunction.func1.1()\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2390 +0x77\ngithub.com/dop251/goja.(*vm).try(0xc0017da360, 0xc0007376c0)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/vm.go:811 +0x244\ngithub.com/dop251/goja.(*Runtime).runWrapped(0xc002294400, 0x7f9015085a68?)\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2434 +0x7c\ngithub.com/dop251/goja.AssertFunction.func1({0x1a85770?, 0x2819660?}, {0xc002422340?, 0x1?, 0x1?})\n\tgithub.com/dop251/goja@v0.0.0-20230919151941-fc55792775de/runtime.go:2389 +0x92\ngo.k6.io/k6/js.(*VU).runFn.func2.1()\n\tgo.k6.io/k6@v0.47.0/js/runner.go:848 +0x44\ngo.k6.io/k6/js/eventloop.(*EventLoop).Start(0xc000be4a00, 0xc00270ee40)\n\tgo.k6.io/k6@v0.47.0/js/eventloop/eventloop.go:177 +0x1bd\ngo.k6.io/k6/js.(*VU).runFn.func2()\n\tgo.k6.io/k6@v0.47.0/js/runner.go:847 +0xea\ngo.k6.io/k6/js/common.RunWithPanicCatching({0x1a89ba0?, 0xc00059f700?}, 0x0?, 0x0?)\n\tgo.k6.io/k6@v0.47.0/js/common/util.go:86 +0x87\ngo.k6.io/k6/js.(*VU).runFn(0xc0022cf0e0, {0x1a76be0, 0xc000c00370}, 0xa0?, 0xc000010498, 0xc002422310, {0xc002422340, 0x1, 0x1})\n\tgo.k6.io/k6@v0.47.0/js/runner.go:846 +0x28a\ngo.k6.io/k6/js.(*ActiveVU).RunOnce(0xc000bd40c0)\n\tgo.k6.io/k6@v0.47.0/js/runner.go:788 +0x4df\ngo.k6.io/k6/lib/executor.getIterationRunner.func1({0x1a76c88, 0xc002735020}, {0x1a699c0?, 0xc000bd40c0?})\n\tgo.k6.io/k6@v0.47.0/lib/executor/helpers.go:81 +0x64\ngo.k6.io/k6/lib/executor.ConstantVUs.Run.func5({0x1a714b0, 0xc0022cf0e0})\n\tgo.k6.io/k6@v0.47.0/lib/executor/constant_vus.go:193 +0x32f\ncreated by go.k6.io/k6/lib/executor.ConstantVUs.Run\n\tgo.k6.io/k6@v0.47.0/lib/executor/constant_vus.go:204 +0x90e\n\nGoja stack:\n" data_received........: 0 B 0 B/s data_sent............: 0 B 0 B/s iteration_duration...: avg=20.2ms min=20.2ms med=20.2ms max=20.2ms p(90)=20.2ms p(95)=20.2ms iterations...........: 1 35.782862/s running (00.0s), 0/2 VUs, 0 complete and 2 interrupted iterations default ✗ [ 2% ] 2 VUs 0.0s/1s time="2024-04-09T12:12:24Z" level=error msg="a panic occurred during JS execution: runtime error: invalid memory address or nil pointer dereference"
The text was updated successfully, but these errors were encountered:
hi @pirods can you try building with docker like :
docker run --rm -it -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" grafana/xk6 build v0.43.1 \ --with github.com/gjergjsheldija/xk6-mllp=.
and then running as described in the docs ?
Sorry, something went wrong.
No branches or pull requests
Hey there. I'm using this version:
And running a simple test through docker with:
docker run --volume "$(pwd)/examples":/test --workdir "/test" -i k6local:latest run /test/test.js
I edited the test.js script according to my needs (mostly adding my server url):
My server receives one message correctly for each vu, but at the second iteration, this is the error I get:
The text was updated successfully, but these errors were encountered: