keploy
keploy copied to clipboard
[bug]: Keploy:Recovered from:runtime error: slice bounds out of range [1:0]
Is there an existing issue for this?
- [X] I have searched the existing issues
Current behavior
When I send http request to api, api will hang when connect to MySQL.
After recording and run test, then I got error that is Keploy:Recovered from:runtime error: slice bounds out of range [1:0]
$ keploy test -c "go run ." --delay 10
▓██▓▄
▓▓▓▓██▓█▓▄
████████▓▒
▀▓▓███▄ ▄▄ ▄ ▌
▄▌▌▓▓████▄ ██ ▓█▀ ▄▌▀▄ ▓▓▌▄ ▓█ ▄▌▓▓▌▄ ▌▌ ▓
▓█████████▌▓▓ ██▓█▄ ▓█▄▓▓ ▐█▌ ██ ▓█ █▌ ██ █▌ █▓
▓▓▓▓▀▀▀▀▓▓▓▓▓▓▌ ██ █▓ ▓▌▄▄ ▐█▓▄▓█▀ █▓█ ▀█▄▄█▀ █▓█
▓▌ ▐█▌ █▌
▓
version: 2.0.0-alpha78
🐰 Keploy: 2024-03-14T23:20:08Z INFO Keploy config not found, continuing without configuration
🐰 Keploy: 2024-03-14T23:20:08Z INFO {"keploy test and mock path": "/home/ubuntu/dev/github.com/ubuntu/keploy-example/backend/api/keploy"}
🐰 Keploy: 2024-03-14T23:20:08Z INFO {"keploy testReport path": "/home/ubuntu/dev/github.com/ubuntu/keploy-example/backend/api/keploy/testReports/test-run-3"}
🐰 Keploy: 2024-03-14T23:20:14Z INFO keploy initialized and probes added to the kernel.
🐰 Keploy: 2024-03-14T23:20:15Z INFO Keploy has hijacked the DNS resolution mechanism, your application may misbehave in keploy test mode if you have provided wrong domain name in your application code.
🐰 Keploy: 2024-03-14T23:20:15Z INFO Proxy started at port:16789
🐰 Keploy: 2024-03-14T23:20:15Z INFO starting TCP DNS server at addr :26789
🐰 Keploy: 2024-03-14T23:20:15Z INFO starting UDP DNS server at addr :26789
🐰 Keploy: 2024-03-14T23:20:15Z WARN request or response timestamp of mock is missing for fake-tc
🐰 Keploy: 2024-03-14T23:20:15Z WARN request or response timestamp of mock is missing for fake-tc
🐰 Keploy: 2024-03-14T23:20:15Z INFO running user application for {"test-set": "test-set-0"}
🐰 Keploy: 2024-03-14T23:20:15Z INFO {"no of test cases": 4, "test-set": "test-set-0"}
2024/03/14 23:20:16 start http server :8080
🐰 Keploy: 2024-03-14T23:20:25Z WARN request or response timestamp of mock is missing for test-1
🐰 Keploy: 2024-03-14T23:20:25Z WARN request or response timestamp of mock is missing for test-1
🐰 Keploy: 2024-03-14T23:20:25Z INFO starting test for of {"test case": "test-1", "test set": "test-set-0"}
Testrun passed for testcase with id: "test-1"
--------------------------------------------------------------------
🐰 Keploy: 2024-03-14T23:20:25Z INFO result {"testcase id": "test-1", "testset id": "test-set-0", "passed": "true"}
🐰 Keploy: 2024-03-14T23:20:25Z WARN request or response timestamp of mock is missing for test-2
🐰 Keploy: 2024-03-14T23:20:25Z WARN request or response timestamp of mock is missing for test-2
🐰 Keploy: 2024-03-14T23:20:25Z INFO starting test for of {"test case": "test-2", "test set": "test-set-0"}
[mysql] 2024/03/14 23:20:25 connection.go:668: closing bad idle connection: EOF
🐰 Keploy: 2024-03-14T23:20:25Z ERROR Failed to match request with mock {"error": "no matching mock found"}
[mysql] 2024/03/14 23:20:25 packets.go:37: unexpected EOF
2024/03/14 23:20:25 [ERROR] 🐰 Keploy:Recovered from:runtime error: slice bounds out of range [1:0]
stack trace:
goroutine 68 [running]:
runtime/debug.Stack()
/opt/hostedtoolcache/go/1.21.7/x64/src/runtime/debug/stack.go:24 +0x5e
go.keploy.io/server/utils.HandlePanic()
/home/runner/work/keploy/keploy/utils/utils.go:134 +0xd4
panic({0x14da2e0?, 0xc00111d368?})
/opt/hostedtoolcache/go/1.21.7/x64/src/runtime/panic.go:914 +0x21f
go.keploy.io/server/pkg/proxy/integrations/mysqlparser.decodeOutgoingMySQL({0xc001123ba0?, 0xc001172480?, 0xc?}, {0x18fb7d8?, 0xc000636248}, {0x0, 0x0}, 0xc000198d80, 0xc0048b1b00?, {0x18f6f18, ...}, ...)
/home/runner/work/keploy/keploy/pkg/proxy/integrations/mysqlparser/mysqlparser.go:504 +0x19ed
go.keploy.io/server/pkg/proxy/integrations/mysqlparser.(*MySqlParser).ProcessOutgoing(0x15552ac?, {0x231f180?, 0x2?, 0x3?}, {0x18fb7d8?, 0xc000636248?}, {0x0?, 0x0?}, {0x18f6f18, 0x231f180})
/home/runner/work/keploy/keploy/pkg/proxy/integrations/mysqlparser/mysqlparser.go:41 +0x9e
go.keploy.io/server/pkg/proxy.(*ProxySet).handleConnection(0xc00349e000, {0x18fb7d8, 0xc000636248}, 0x4195?, {0x18f6f18, 0x231f180})
/home/runner/work/keploy/keploy/pkg/proxy/proxy.go:863 +0x1437
go.keploy.io/server/pkg/proxy.(*ProxySet).startProxy.func1()
/home/runner/work/keploy/keploy/pkg/proxy/proxy.go:607 +0xd7
created by go.keploy.io/server/pkg/proxy.(*ProxySet).startProxy in goroutine 38
/home/runner/work/keploy/keploy/pkg/proxy/proxy.go:604 +0x84a
🐰 Keploy: 2024-03-14T23:20:30Z ERROR failed sending testcase request to app
Testrun failed for testcase with id: "test-2"
--------------------------------------------------------------------
+-------------------------------------------------------------------------------------------------------------+
| DIFFS TEST-2 |
+-------------------------------------------------------------------------------------------------------------+
| EXPECT STATUS | ACTUAL STATUS |
| -----------------------------------------------------+----------------------------------------------------- |
| 500 | 0 |
| | |
| |
| EXPECT HEADER | ACTUAL HEADER |
| -----------------------------------------------------+----------------------------------------------------- |
| Content-Length: [26] | Content-Length: [] |
| Content-Type: [text/plain; charset=utf-8] | Content-Type: [] |
| X-Content-Type-Options: [nosniff] | X-Content-Type-Options: [] |
| | |
| |
| EXPECT BODY | ACTUAL BODY |
| -----------------------------------------------------+----------------------------------------------------- |
| context deadline exceeded | Get "http://localhost:8080/todos": context deadlin |
| | e exceeded (Client.Timeout exceeded while awaiting |
| | headers) |
| | |
| |
+-------------------------------------------------------------------------------------------------------------+
🐰 Keploy: 2024-03-14T23:20:30Z INFO {"matched mocks": []}
🐰 Keploy: 2024-03-14T23:20:30Z INFO result {"testcase id": "test-2", "testset id": "test-set-0", "passed": "false"}
🐰 Keploy: 2024-03-14T23:20:30Z WARN request or response timestamp of mock is missing for test-3
🐰 Keploy: 2024-03-14T23:20:30Z WARN request or response timestamp of mock is missing for test-3
🐰 Keploy: 2024-03-14T23:20:30Z INFO starting test for of {"test case": "test-3", "test set": "test-set-0"}
🐰 Keploy: 2024-03-14T23:20:30Z ERROR Failed to match request with mock {"error": "no matching mock found"}
Steps to reproduce
- git clone https://github.com/skanehira/keploy-example
- cd backend/api && keploy test -c "go run ." --delay 10
Environment
Deploy preview
Version
Local
Repository
keploy
Thank you and congratulations 🎉 for opening your very first issue in keploy
Hi @skanehira I am working on this issue. Will update you soon as we merge it into main .
@Sarthak160 Thank you :)
@skanehira I think this issue is resolved. Can you please check it once on your end?
Any update on this? @gouravkrosx
@Swpn0neel It couldn't replicate it, If @skanehira is still facing that issue we can then work on it.
@gouravkrosx Thank you :) I'll check it in this week