Strange assert_equals
behaviour for tables returned from or passed to server:exec
#310
Labels
bug
Something isn't working
TL; DR:
t.assert_equals(expect_tbl, return_tbl)
on line 19 fails, butt.assert_equals(return_tbl, expect_tbl)
on line 20 passes!t.assert_equals(tbl, expect)
on line 24 fails, butt.assert_equals(expect, tbl)
on line 23 passes!The problems I see:
a)
server:exec()
encodes table arguments / return values with extrabox.NULL
when passing them to / from other serverb)
assert_equals
works when the argument passed over the net is first, but doesn't work when that argument is second.The details:
Consider the following reproducer:
repro_test.lua
When I run it with luatest,
luatest repro_test.lua -v
, it fails like this:fail 1
Now, if I comment the line 19 (
t.assert_equals(expect_tbl, return_tbl)
), it starts failing in another place.(Note, that line 20 passes successfully (
t.assert_equals(return_tbl, expect_tbl)
) and it has the same arguments as line 19 in reverse order.fail2
Ok, now I comment out line 24 (
t.assert_equals(_G.ballot, expect)
) and the test passes! So:t.assert_equals(expect_tbl, return_tbl)
on line 19 fails, butt.assert_equals(return_tbl, expect_tbl)
on line 20 passes!t.assert_equals(tbl, expect)
on line 24 fails, butt.assert_equals(expect, tbl)
on line 23 passes!The problems I see:
a)
server:exec()
encodes table arguments / return values with extrabox.NULL
when passing them to / from other serverb)
assert_equals
works when the argument passed over the net is first, but doesn't work when that argument is second.The text was updated successfully, but these errors were encountered: