retryProtocol = (errorType, fn) =>
  waitFor(
    async () => {
      try {
        return await fn()
      } catch (e) {
        if (e.type !== errorType) {
          throw e
        }
        return false
      }
    },
    { ignoreTimeout: true }
  )
@param {import("../types").KafkaJSError} errorType
@param {() => Promise<T>} fn
@returns {Promise<T>}
@template T