Busted reloads your dependencies for each test, along with LuaJIT's FFI definitions, which can be loaded only once.
You can fix it by using busted with this helper: https://github.com/Olivine-Labs/luassert/pull/150/files
W dniu środa, 22 listopada 2017 15:35:25 UTC+1 użytkownik Henrique Chehad napisał:
Another example:
# luajit
JIT: ON SSE2 SSE3 SSE4.1 fold cse dce fwd dse narrow loop abc sink fuse
>
>
>
> dofile "/usr/local/openresty/lualib/resty/sha.lua"
> dofile "/usr/local/openresty/lualib/resty/sha.lua"
/usr/local/openresty/lualib/resty/sha.lua:17: attempt to redefine 'SHA_LBLOCK' at line 5
stack traceback:
[C]: in function 'cdef'
/usr/local/openresty/lualib/resty/sha.lua:17: in main chunk
[C]: in function 'dofile'
stdin:1: in main chunk
[C]: at 0x00405370
>
>
Em terça-feira, 21 de novembro de 2017 19:09:04 UTC-2, Henrique Chehad escreveu:
Hello, during the tests using busted it returns some errors when a external lib runs "require resty/sha".
I don't see exactly if it's an issue in the api-gateway-aws lib or the OpenResty 1.13.6.1rc1, it started after the OpenResty update.
$ ./busted
●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●●●●●●●●●●●●●●●●●●●●●●●●●●●◌●●◌●●●●●●●●◌●●●●●●●●●●●●●stack traceback:
/usr/local/openresty/lualib/resty/sha.lua:9: in main chunk
[C]: in function 'require'
/usr/local/openresty/lualib/resty/sha256.lua:4: in main chunk
[C]: in function 'require'
./vendor/api-gateway/aws/AwsV4Signature.lua:9: in main chunk
[C]: in function 'require'
./vendor/api-gateway/aws/AwsService.lua:33: in main chunk
●●●◌●●●●◌◌◌●●●●●●●●●●●●●●●●●●●◌stack traceback: