Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.cancel() Freezes Upon Testing #534

Open
raim-io opened this issue Dec 19, 2024 · 0 comments
Open

.cancel() Freezes Upon Testing #534

raim-io opened this issue Dec 19, 2024 · 0 comments

Comments

@raim-io
Copy link

raim-io commented Dec 19, 2024

Hello, my gratitude extends to the creators and maintainers of this outstanding service. It is truly amazing and has been incredibly helpful in my projects. I deeply appreciate the time and expertise you've invested in creating and maintaining such a reliable tool.

I am currently working on a flow that allows a client to cancel a service, thereby cancelling any pending auto renewal job (excluding completed and already cancelled jobs).

However, my test seems to freeze at the point where the job cancellation method is being invoked, thereby resulting in test timeouts, regardless of the test timeout duration.

Upon tracing this, it freezes when the executeSql function is being invoked:

async executeSql (text, values) {
    if (this.opened) {
      // if (this.config.debug === true) {
      //   console.log(`${new Date().toISOString()}: DEBUG SQL`)
      //   console.log(text)

      //   if (values) {
      //     console.log(`${new Date().toISOString()}: DEBUG VALUES`)
      //     console.log(values)
      //   }
      // }

      return await this.pool.query(text, values) // <<- AT THIS POINT
    }
  }

On inspecting the pgboss.job table of the test database, the jobs were indeed getting cancelled but then the delay still persists within the test, causing timeouts.

I initially assumed that this could be some sort of transaction issue but then the jobs are being updated on the test database still within the global transactions.

What could be the reason for this please?

@raim-io raim-io changed the title .cancel Freezes Upon Testing .cancel() Freezes Upon Testing Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant