Transaction Timeout Problem On Tests


I use transactions in a controller method;

await Database.transaction(async (trx) => {
  // some database changes

Also I have HTTP Tests. I use Sqlite. But when I execute this code, I get timeout error on tests;

 1. a new work source type should be able to create
  Error: Test timeout, ensure "done()" is called; if returning a Promise, ensure it resolves.
    at Test._parseError (/home/ozzy/Desktop/gitlab/api/node_modules/japa/src/Test.js:109:16)
    at (/home/ozzy/Desktop/gitlab/api/node_modules/japa/src/Test.js:195:21)

Even I increase timeout period, it doesn’t work. But if I don’t create a transaction, it works fine. What is the problem?

Also I tried trait('DatabaseTransactions') but it didn’t work.

1 Like

Tried setting timeout to 0?


I tried but it was same. But I solved the problem.

Inside the transaction, I have to tell that I have a transaction in query operations. This is same issue with this

1 Like