ethersphere/gateway-proxy

Replace the `waitUntilStampUsable` with version implemented in `bee-js`

vojtechsimetka opened this issue · 0 comments

This is needed because it causes leaks in integration tests. https://github.com/ethersphere/gateway-proxy/blob/master/src/stamps.ts#L73-L101

Jest has detected the following 1 open handle potentially keeping Jest from exiting:

  ●  Timeout

      82 |   const timeoutPromise = async (): Promise<never> =>
      83 |     new Promise((_, reject) =>
    > 84 |       setTimeout(() => {
         |       ^
      85 |         timeoutReached = true
      86 |         reject(new Error('Wait until stamp usable timeout has been reached'))
      87 |       }, timeout),

      at ../src/stamps.ts:84:7
      at ../src/stamps.ts:83:5
      at ../src/stamps.ts:8:71
      at Object.<anonymous>.__awaiter (../src/stamps.ts:4:12)
      at timeoutPromise (../src/stamps.ts:82:53)
      at ../src/stamps.ts:100:44
      at ../src/stamps.ts:8:71
      at Object.<anonymous>.__awaiter (../src/stamps.ts:4:12)
      at waitUntilStampUsable (../src/stamps.ts:73:12)
      at stamps.spec.ts:265:31
      at stamps.spec.ts:8:71
      at Object.<anonymous>.__awaiter (stamps.spec.ts:4:12)
      at Object.<anonymous> (stamps.spec.ts:257:54)