scripts/test-bend-tests/README.md
Test setup for running a Databend cluster with 3 meta nodes and 1 query node.
test-bend-tests/
├── configs/
│ ├── meta-node1.toml # Meta node 1 (id=1, ports: grpc=9191, admin=29001, raft=27001)
│ ├── meta-node2.toml # Meta node 2 (id=2, ports: grpc=9192, admin=29002, raft=27002)
│ ├── meta-node3.toml # Meta node 3 (id=3, ports: grpc=9193, admin=29003, raft=27003)
│ └── query-node1.toml # Query node 1 (HTTP=8000, MySQL=3307)
├── test_cluster.py # Main test script
└── README.md # This file
IMPORTANT: You must install the databend_test_helper library before running this test:
cd ../databend_test_helper
pip install -e .
Build Databend binaries (debug):
cd ../.. # Go to project root
make build
Run the test cluster:
cd scripts/test-bend-tests
python test_cluster.py
If you get ModuleNotFoundError: No module named 'databend_test_helper', you forgot step 1 in Prerequisites.
Once running, you can connect to:
http://127.0.0.1:8000mysql://[email protected]:3307 (no password)All logs are written to _databend_data/logs/:
meta1/, meta2/, meta3/ - Meta node logsquery1/ - Query node logsAll data is stored in _databend_data/:
meta1/, meta2/, meta3/ - Raft dataquery1/ - Query datacache/query1/ - Query cachespill/query1/ - Query spill filesBring up cluster:
python test_cluster.py
Run test:
python concurrent_sql_test.py --threads 10 -i 1000 --servers localhost:8000,localhost:8001,localhost:8002,localhost:8003,localhost:8004 --query='SELECT count(*) FROM yy a JOIN yy b ON a.number < b.number WHERE a.number * b.number < 1000000 and a.number < 10000;'
# run a single test:
bendsql --user ana --password '123' --query='SELECT count(*) FROM yy a JOIN yy b ON a.number < b.number WHERE a.number * b.number < 1000000 and a.number < 10000;'
Check pending status:
bendsql --user ana --password '123' --query='show processlist;'
# or
bendsql --user ana --password '123' --query='show processlist;' | grep '\[.*' -o | sort