Skip to content

Commit

Permalink
test: added delay in concurrent partitioned table updates test to en…
Browse files Browse the repository at this point in the history
…sure query is processed before concurrent commit is called (#262)

* dont close connection after `IMPLICIT_TRANSACTION` query, return in to pool instead

* added "tuple moved to another partition" error handling

* fixed eslint

* improved tests

* added delay in concurrent partitioned table updates test to ensure query is processed before concurrent commit is called

* Update test/slonik/integration.ts

Co-authored-by: George Skarbovskiy <skarbovskyi.h@forpost-system.com>
Co-authored-by: Gajus Kuizinas <gajus@gajus.com>
  • Loading branch information
3 people committed Mar 20, 2021
1 parent 05ae6db commit d4524b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/slonik/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,8 @@ test('Tuple moved to another partition due to concurrent update error handled',
);
t.true(error instanceof TupleMovedToAnotherPartitionError);
});
// Ensures that query is processed before concurrent commit is called.
await delay(1000);
await connection1.query(sql`COMMIT`);
await connection2.query(sql`COMMIT`);
});
Expand Down

0 comments on commit d4524b4

Please sign in to comment.