aerospike / aerospike-client-go

Aerospike Client Go
Apache License 2.0
430 stars 199 forks source link

Fixed panics in Read Command Reflection API #402

Closed un000 closed 11 months ago

un000 commented 1 year ago
Reproducer ``` package main import ( "log" "github.com/aerospike/aerospike-client-go/v6" "github.com/davecgh/go-spew/spew" ) type object struct { Foo int `as:"foo"` // !!! type of Foo is int } func main() { client, err := aerospike.NewClient("127.0.0.1", 3002) if err != nil { log.Fatal(err) } defer client.Close() key, err := aerospike.NewKey("subscriptions", "test", "test") if err != nil { log.Fatal(err) } if err := client.PutBins(nil, key, aerospike.NewBin("foo", "bar")); err != nil { // !!! type of "foo" is string log.Fatal(err) } obj := &object{} if err := client.GetObject(nil, key, obj); err != nil { // panic log.Fatal(err) } spew.Dump(obj) } ```

PR Fixes panics like this:

panic: reflect.Value.Convert: value of type string cannot be converted to type int

goroutine 1 [running]:
reflect.Value.Convert({0x1009b2c00?, 0x1400001e150?, 0x140000bd348?}, {0x100a28de8, 0x1009b2480})
/opt/homebrew/Cellar/go/1.20.1/libexec/src/reflect/value.go:3257 +0x104
github.com/aerospike/aerospike-client-go/v6.setValue({0x1009b2480?, 0x14000026388?, 0x140000bd7f8?}, {0x1009b2c00, 0x1400001e150})
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/read_command_reflect.go:153 +0x278
github.com/aerospike/aerospike-client-go/v6.setObjectField(0x1009d3da0?, {0x1009d3da0?, 0x14000026388?, 0x10000?}, {0x140000bd7f8, 0x3}, {0x1009b2c00, 0x1400001e150})
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/read_command_reflect.go:136 +0xac
github.com/aerospike/aerospike-client-go/v6.parseObject(0x1400013e000, 0x1, 0x0?, 0x10000?, 0x0?)
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/read_command_reflect.go:90 +0x480
github.com/aerospike/aerospike-client-go/v6.(*readCommand).parseResult(0x1400013e000, {0x100a27528, 0x1400013e000}, 0x10000?)
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/read_command.go:171 +0x64c
github.com/aerospike/aerospike-client-go/v6.(*baseCommand).executeAt(0x1400013e000, {0x100a27528, 0x1400013e000}, 0x140000322d0, 0x0?, {0x0?, 0x0?, 0x100bfd480?}, 0x0?, 0x0?)
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/command.go:2617 +0xc5c
github.com/aerospike/aerospike-client-go/v6.(*baseCommand).execute(0x0?, {0x100a27528, 0x1400013e000}, 0x0?)
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/command.go:2440 +0x74
github.com/aerospike/aerospike-client-go/v6.(*readCommand).Execute(...)
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/read_command.go:264
github.com/aerospike/aerospike-client-go/v6.(*Client).GetObject(0x1400006e3c0, 0x100a20f88?, 0x10090294e?, {0x1009aaa20?, 0x14000026388})
/Users/un0/go/pkg/mod/github.com/aerospike/aerospike-client-go/v6@v6.12.0/client_reflect.go:75 +0x318
main.main()
/Users/un0/go/src/cmd/reproducer/main.go:32 +0x1f0
exit status 2

They happens because of mismatching types inside Aerospike and struct type definitions.

@khaf

un000 commented 1 year ago
Test Before Changes ``` ➜ aerospike-client-go git:(fix-panic-in-read-command-reflect) ✗ ACK_GINKGO_RC=true ginkgo -r --focus-file read_command_reflect_test.go -v 2023/05/14 16:29:05 Connecting to seeds: [127.0.0.1:3000] Running Suite: Aerospike Client Library Suite - /Users/un0/go/src/github.com/un000/aerospike-client-go ====================================================================================================== Random Seed: 1684067341 Will run 26 of 515 specs SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS ------------------------------ Read Command Reflect setValue []int->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []int->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 • [FAILED] [0.000 seconds] Read Command Reflect setValue []int->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type []int cannot be converted to type int In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 ------------------------------ Read Command Reflect setValue []int->int64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 • [FAILED] [0.000 seconds] Read Command Reflect setValue []int->int64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type []int cannot be converted to type int64 In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 ------------------------------ Read Command Reflect setValue []int->map[string]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 • [FAILED] [0.000 seconds] Read Command Reflect setValue []int->map[string]string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*runtime.TypeAssertionError | 0x14000998ff0>: interface conversion: interface {} is []int, not map[interface {}]interface {} { _interface: {size: 0x10, ptrdata: 0x10, hash: 252279353, tflag: 2, align: 8, fieldAlign: 8, kind: 20, equal: 0x1040632f0, gcdata: 2, str: 56465, ptrToThis: 203392}, concrete: {size: 0x18, ptrdata: 0x8, hash: 2574742403, tflag: 2, align: 8, fieldAlign: 8, kind: 23, equal: nil, gcdata: 1, str: 10016, ptrToThis: 178176}, asserted: {size: 0x8, ptrdata: 0x8, hash: 1854114263, tflag: 2, align: 8, fieldAlign: 8, kind: 53, equal: nil, gcdata: 1, str: 149226, ptrToThis: 0}, missingMethod: "", } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 ------------------------------ Read Command Reflect setValue []string->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 • [FAILED] [0.000 seconds] Read Command Reflect setValue []string->[]int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type string cannot be converted to type int In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 ------------------------------ Read Command Reflect setValue []string->[]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []string->float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 • [FAILED] [0.000 seconds] Read Command Reflect setValue []string->float64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*runtime.TypeAssertionError | 0x140009996e0>: interface conversion: interface {} is []string, not int { _interface: {size: 0x10, ptrdata: 0x10, hash: 252279353, tflag: 2, align: 8, fieldAlign: 8, kind: 20, equal: 0x1040632f0, gcdata: 2, str: 56465, ptrToThis: 203392}, concrete: {size: 0x18, ptrdata: 0x8, hash: 3908964021, tflag: 2, align: 8, fieldAlign: 8, kind: 23, equal: nil, gcdata: 1, str: 25504, ptrToThis: 0}, asserted: {size: 0x8, ptrdata: 0x0, hash: 3413333906, tflag: 15, align: 8, fieldAlign: 8, kind: 2, equal: 0x104063120, gcdata: 0, str: 1820, ptrToThis: 203072}, missingMethod: "", } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.421 ------------------------------ Read Command Reflect setValue []string->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 • [FAILED] [0.000 seconds] Read Command Reflect setValue []string->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type []string cannot be converted to type int In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 ------------------------------ Read Command Reflect setValue []string->int64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 • [FAILED] [0.000 seconds] Read Command Reflect setValue []string->int64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type []string cannot be converted to type int64 In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 ------------------------------ Read Command Reflect setValue bool->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 • [FAILED] [0.000 seconds] Read Command Reflect setValue bool->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type bool cannot be converted to type int In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 ------------------------------ Read Command Reflect setValue bool->string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 • [FAILED] [0.000 seconds] Read Command Reflect setValue bool->string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*runtime.TypeAssertionError | 0x14000bc0120>: interface conversion: interface {} is bool, not string { _interface: {size: 0x10, ptrdata: 0x10, hash: 252279353, tflag: 2, align: 8, fieldAlign: 8, kind: 20, equal: 0x1040632f0, gcdata: 2, str: 56465, ptrToThis: 203392}, concrete: {size: 0x1, ptrdata: 0x0, hash: 2953551688, tflag: 15, align: 1, fieldAlign: 1, kind: 1, equal: 0x1040630c0, gcdata: 0, str: 4270, ptrToThis: 179072}, asserted: {size: 0x10, ptrdata: 0x8, hash: 125357496, tflag: 7, align: 8, fieldAlign: 8, kind: 24, equal: 0x104063210, gcdata: 1, str: 14368, ptrToThis: 215680}, missingMethod: "", } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 ------------------------------ Read Command Reflect setValue int->[]float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 • [FAILED] [0.000 seconds] Read Command Reflect setValue int->[]float64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*reflect.ValueError | 0x14000b029d8>: reflect: call of reflect.Value.Len on int Value { Method: "reflect.Value.Len", Kind: 2, } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.422 ------------------------------ Read Command Reflect setValue int->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.423 • [FAILED] [0.000 seconds] Read Command Reflect setValue int->[]int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*reflect.ValueError | 0x14000b02b28>: reflect: call of reflect.Value.Len on int Value { Method: "reflect.Value.Len", Kind: 2, } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.423 ------------------------------ Read Command Reflect setValue int->[]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.423 • [FAILED] [0.000 seconds] Read Command Reflect setValue int->[]string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*reflect.ValueError | 0x14000b02c78>: reflect: call of reflect.Value.Len on int Value { Method: "reflect.Value.Len", Kind: 2, } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.423 ------------------------------ Read Command Reflect setValue int->bool Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->int64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.423 • [FAILED] [0.000 seconds] Read Command Reflect setValue int->string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*runtime.TypeAssertionError | 0x14000bc1140>: interface conversion: interface {} is int, not string { _interface: {size: 0x10, ptrdata: 0x10, hash: 252279353, tflag: 2, align: 8, fieldAlign: 8, kind: 20, equal: 0x1040632f0, gcdata: 2, str: 56465, ptrToThis: 203392}, concrete: {size: 0x8, ptrdata: 0x0, hash: 3413333906, tflag: 15, align: 8, fieldAlign: 8, kind: 2, equal: 0x104063120, gcdata: 0, str: 1820, ptrToThis: 203072}, asserted: {size: 0x10, ptrdata: 0x8, hash: 125357496, tflag: 7, align: 8, fieldAlign: 8, kind: 24, equal: 0x104063210, gcdata: 1, str: 14368, ptrToThis: 215680}, missingMethod: "", } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.423 ------------------------------ Read Command Reflect setValue map[interface{}]interface{}->map[interface{}]interface{} Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[string]float64->map[string]float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[string]string->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.424 • [FAILED] [0.000 seconds] Read Command Reflect setValue map[string]string->[]int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with <*reflect.ValueError | 0x14000b02138>: reflect: call of reflect.Value.Index on map Value { Method: "reflect.Value.Index", Kind: 21, } In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.424 ------------------------------ Read Command Reflect setValue map[string]string->map[string]float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.424 • [FAILED] [0.000 seconds] Read Command Reflect setValue map[string]string->map[string]float64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type string cannot be converted to type float64 In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.424 ------------------------------ Read Command Reflect setValue map[string]string->map[string]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue string->bool Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue string->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] in [It] - /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.424 • [FAILED] [0.000 seconds] Read Command Reflect setValue string->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 [FAILED] Expected : 0x104473060 not to panic, but panicked with : reflect.Value.Convert: value of type string cannot be converted to type int In [It] at: /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 @ 05/14/23 16:29:05.424 ------------------------------ SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS Summarizing 16 Failures: [FAIL] Read Command Reflect setValue []int->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue []int->int64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue []int->map[string]string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue []string->[]int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue []string->float64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue []string->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue []string->int64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue bool->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue bool->string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue int->[]float64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue int->[]int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue int->[]string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue int->string [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue map[string]string->[]int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue map[string]string->map[string]float64 [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 [FAIL] Read Command Reflect setValue string->int [It] Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:90 Ran 26 of 515 Specs in 0.014 seconds FAIL! -- 10 Passed | 16 Failed | 0 Pending | 489 Skipped ```
Test After Changes ``` ➜ aerospike-client-go git:(fix-panic-in-read-command-reflect) ✗ ACK_GINKGO_RC=true ginkgo -r --focus-file read_command_reflect_test.go -v 2023/05/14 16:31:09 Connecting to seeds: [127.0.0.1:3000] Running Suite: Aerospike Client Library Suite - /Users/un0/go/src/github.com/un000/aerospike-client-go ====================================================================================================== Random Seed: 1684067468 Will run 26 of 515 specs SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS ------------------------------ Read Command Reflect setValue []int->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []int->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []int->int64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []int->map[string]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []string->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []string->[]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []string->float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []string->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue []string->int64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue bool->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue bool->string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->[]float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->[]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->bool Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->int64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue int->string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[interface{}]interface{}->map[interface{}]interface{} Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[string]float64->map[string]float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[string]string->[]int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[string]string->map[string]float64 Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue map[string]string->map[string]string Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue string->bool Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ Read Command Reflect setValue string->int Should return correct error /Users/un0/go/src/github.com/un000/aerospike-client-go/read_command_reflect_test.go:82 • [0.000 seconds] ------------------------------ SSSSSSSSSSSSSSSS Ran 26 of 515 Specs in 0.012 seconds SUCCESS! -- 26 Passed | 0 Failed | 0 Pending | 489 Skipped ```
un000 commented 1 year ago

@khaf could you review this?

khaf commented 1 year ago

@un000 Sure, sorry for the delay. Will release this week.