All Projects → pingcap → tipocket

pingcap / tipocket

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE MIT Porcupine-LICENSE
A toolkit for testing TiDB

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to tipocket

django-transactions-tutorial
django-transactions-tutorial 基本教學 - 了解 transactions 概念 📝
Stars: ✭ 33 (-72.95%)
Mutual labels:  consistency, isolation
Chaos Mesh
A Chaos Engineering Platform for Kubernetes.
Stars: ✭ 4,265 (+3395.9%)
Mutual labels:  chaos, chaos-mesh
DynamicalBilliards.jl
An easy-to-use, modular, extendable and absurdly fast Julia package for dynamical billiards in two dimensions.
Stars: ✭ 97 (-20.49%)
Mutual labels:  chaos
ConsistencyPlus
Consistency+ is a mod that aims to fix the inconsistencies with block variants added by Mojang.
Stars: ✭ 63 (-48.36%)
Mutual labels:  consistency
chaos-2
A hand-made SMP-aware kernel
Stars: ✭ 20 (-83.61%)
Mutual labels:  chaos
awesome-chaos-engineering
Awesome chaos engineering page
Stars: ✭ 18 (-85.25%)
Mutual labels:  chaos
credo naming
🏷 A suite of Credo checks to enforce naming best practices in an Elixir project
Stars: ✭ 68 (-44.26%)
Mutual labels:  consistency
hax
Zero-config Hacky Hackpecker setup
Stars: ✭ 16 (-86.89%)
Mutual labels:  chaos
chaospy
Chaotic attractors (Lorenz, Rossler, Rikitake etc.)
Stars: ✭ 47 (-61.48%)
Mutual labels:  chaos
DelayEmbeddings.jl
Delay coordinates embedding and Dataset definitions
Stars: ✭ 21 (-82.79%)
Mutual labels:  chaos
cas
Cellular Automata Simulator
Stars: ✭ 22 (-81.97%)
Mutual labels:  chaos
Performance-Engineers-DevOps
This repository helps performance testers and engineers who wants to dive into DevOps and SRE world.
Stars: ✭ 35 (-71.31%)
Mutual labels:  chaos
hybris
Robust and strongly consistent hybrid cloud storage library
Stars: ✭ 13 (-89.34%)
Mutual labels:  consistency
Example
Metarhia application example for Node.js
Stars: ✭ 147 (+20.49%)
Mutual labels:  isolation
xidoc
A consistent markup language
Stars: ✭ 40 (-67.21%)
Mutual labels:  consistency
better-redux-tests
Source code for my article "A better approach for testing your Redux code"
Stars: ✭ 12 (-90.16%)
Mutual labels:  isolation
GlotDict
This extension for WordPress polyglots implements new features to improve the quality of translation/reviews!
Stars: ✭ 52 (-57.38%)
Mutual labels:  consistency
NamingThings
Content on tips, tricks, advice, practices for naming things in in software/technology
Stars: ✭ 31 (-74.59%)
Mutual labels:  consistency
Star-lang-specification
Work in progress specs for the Star programming language
Stars: ✭ 26 (-78.69%)
Mutual labels:  consistency
Fatou.jl
Fatou sets in Julia (Fractals, Newton basins, Mandelbrot)
Stars: ✭ 92 (-24.59%)
Mutual labels:  chaos

TiPocket

TiPocket is a testing toolkit designed to test TiDB, it encapsulates some testing tools which are also suitable for testing other databases.

TiPocket is inspired by jepsen-io/jepsen, a famous library on the distributed system field. TiPocket focuses on stability testing on TiDB, it uses chaos-mesh to inject all-round kinds of nemesis on a TiDB cluster.

Requirements

Toolkit

  • go-sqlsmith: go-sqlsmith is our Go implementation of sqlsmith, it's a fuzz-testing tool which can generate random MySQL-dialect SQL queries.
  • go-elle: Our Go port version of jepsen-io/elle, a general transactional consistency checker for black-box databases.

Nemesis

  • random_kill, all_kill, minor_kill, major_kill, kill_tikv_1node_5min, kill_pd_leader_5min: As their name implies, these nemeses inject unavailable in a specified period of time.
  • short_kill_tikv_1node, short_kill_pd_leader: Kill selected container, used to inject short duration of unavailable fault.
  • partition_one: Isolate single nodes
  • scaling: Scale up/down TiDB/PD/TiKV nodes randomly
  • shuffle-leader-scheduler/shuffle-region-scheduler/random-merge-scheduler: Just as there name implies
  • delay_tikv, delay_pd, errno_tikv, errno_pd, mixed_tikv, mixed_pd: Inject IO-related fault.
  • small_skews, subcritical_skews, critical_skews, big_skews, huge_skews: Clock skew, small_skews ~100ms, subcritical_skews ~200ms, critical_skews ~250ms, big_skews ~500ms and huge_skews ~5s.

Create a new case

run make init c=$case, for example:

$ make init c=demo
GO15VENDOREXPERIMENT="1" CGO_ENABLED=1 GOOS= GOARCH=amd64 GO111MODULE=on go build -ldflags '-s -w -X "github.com/pingcap/tipocket/pkg/test-infra/fixture.BuildTS=2021-02-05 07:13:54" -X "github.com/pingcap/tipocket/pkg/test-infra/fixture.BuildHash=a70411f45605864da28a5000aff72a226a1ab27f"'  -o bin/tipocket cmd/tipocket/*.go
bin/tipocket init -c demo
create a new case `demo`: testcase/demo

Debug and Run

If you have a K8s cluster, you can use the below commands to deploy and run the case on a TiDB cluster.

On a K8s cluster

Access directly

make build
export KUBECONFIG=${YOUR_KUBECONFIG_PATH}

# direct connect
bin/${testcase} -namespace=${ns} -hub=docker.io -image-version=nightly -storage-class=local-path

This method can't resolve the k8s cluster network accessing and DNS resolution issues, but it's useful for most cases.

Access by a proxy on k8s cluster

export KUBECONFIG=${YOUR_KUBECONFIG_PATH}
kubectl apply -f hacks/debug/k8s-proxy.yaml -n ${ns}
bin/${testcase} -mysql-proxy=socks5://${a_node_ip}:30080 -namespace=${ns} -hub=docker.io -image-version=nightly -storage-class=local-path

This method overcomes the k8s cluster network accessing problem, but one flaw is retained: DNS resolution, so proxychains-ng is recommended here (if you don't mind to install it: brew install proxychains-ng).

export KUBECONFIG=${YOUR_KUBECONFIG_PATH}
kubectl apply -f hacks/debug/k8s-proxy.yaml -n ${ns}
# edit hacks/debug/proxychains.conf, replace REPLACE_ME_WITH_REAL_NODE_IP with a k8s node ip,
# you can connect to the k8s administrator to get a k8s node ip
proxychains4 -f hacks/debug/proxychains.conf bin/${testcase} -mysql-proxy=socks5://${a_node_ip}:30080 -namespace=${ns} -hub=docker.io -image-version=nightly -storage-class=local-path

On the local environment

Another convenient way we recommend you is using tiup to deploy a cluster on local and use it to debug cases.

  • Start a TiDB cluster
tiup playground --kv 3
  • Specify that cluster address through -tidb-server -tikv-server and -pd-server
bin/${testcase} -tidb-server 127.0.0.1:4000 
  • If a cluster has many service addresses, you can pass a flag multiple times
bin/${testcase} -tikv-server 127.0.0.1:20160 -tikv-server 127.0.0.1:20161

Workloads

TiPocket includes some consistency, isolation and other kinds of tests

Consistency

  • bank transfers between rows of a shared table
  • pbank check bank accounts using a linearizability checker porcupine
  • vbank like bank but cover more TiKV features
  • ledger yet another bank test
  • rawkv-linearizability rawkv linearizability checker
  • tpcc use go-tpc testing consistency

Isolation

  • append checks for dependency cycles in transactions using Elle
  • register checks for write-read dependency cycles over read-write registers using Elle
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].