mhassan1 / redis-memory-server

Redis Server for testing. The server will allow you to connect your favorite client library to the Redis Server and run parallel integration tests isolated from each other.
MIT License
76 stars 11 forks source link

Usually timeout in CI or jest testing. #21

Closed Innei closed 1 year ago

Innei commented 1 year ago

Hi friend, can you put the process of fetching binary and building into the postinstall step? I often experience timeouts during CI or local testing stages (re-installing node_modules).

 FAIL  test/src/modules/user/user.service.spec.ts (7.306 s)
  ● Console

    console.warn
      Starting the instance failed, please enable debug for more infomation

      at ../node_modules/.pnpm/redis-memory-server@0.7.0/node_modules/redis-memory-server/src/RedisMemoryServer.ts:103:19

  ● Test suite failed to run

    Command failed: make
        CC release.o
        CC replication.o
    replication.c:1617:31: error: variable has incomplete type 'struct stat64'
                struct redis_stat buf;
                                  ^
    replication.c:1617:20: note: forward declaration of 'struct stat64'
                struct redis_stat buf;
                       ^
    ./config.h:46:20: note: expanded from macro 'redis_stat'
    #define redis_stat stat64
                       ^
    replication.c:1666:21: error: call to undeclared function 'fstat64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                        redis_fstat(slave->repldbfd,&buf) == -1) {
                        ^
    ./config.h:45:21: note: expanded from macro 'redis_fstat'
    #define redis_fstat fstat64
                        ^
    2 errors generated.
    make[1]: *** [replication.o] Error 1
    make: *** [all] Error 2
mhassan1 commented 1 year ago

Fetching and building already happens in postinstall: https://github.com/mhassan1/redis-memory-server/blob/e65068af78a304109437b60981378a554750cf8c/package.json#L87

I see you are using PNPM. This comment might help (it is for mongodb-memory-server, on which redis-memory-server is based): https://github.com/nodkz/mongodb-memory-server/issues/489#issuecomment-869788691.

Innei commented 1 year ago

Thank you for your reply