mirror of
https://github.com/knex/knex.git
synced 2026-02-05 22:56:50 +00:00
* Added stress test, which uses TCP proxy to simulate flaky connections * Added test code for mysql and mariadb drivers * Dropped trying to figure out support for mariasql driver * Bunch of tests to make knex fail if connections are breaking randomly * Added marker to printout logs before app crash * Fixed mysql acquire connection and destroy conneciton code Acquire connection did bind error handler too late and didn't free it on success. Destroy did free event listeners before connection end was called, so error during connection end leaked out.
19 lines
607 B
Plaintext
Executable File
19 lines
607 B
Plaintext
Executable File
# Test scripts to evaluate stability of drivers / pool etc.
|
|
|
|
# To run this test you need to be in this directory + have node >= 8
|
|
# and startup docker containers with proxy and sql servers
|
|
|
|
docker-compose up --no-start
|
|
docker-compose start
|
|
|
|
# Select different test script to run:
|
|
|
|
node mysql2-random-hanging-every-now-and-then.js 2> /dev/null | grep -B500 -A2 -- "- STATS"
|
|
node mysql2-sudden-exit-without-error
|
|
node knex-stress-test.js | grep -A 3 -- "- STATS "
|
|
node reconnect-test-mysql-based-drivers.js 2> /dev/null | grep -A 3 -- "- STATS "
|
|
|
|
# Shut down docker instances when done:
|
|
|
|
docker-compose down
|