-
Notifications
You must be signed in to change notification settings - Fork 1.2k
149 lines (128 loc) · 5.16 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: test
on:
pull_request:
branches: [ "main" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
basic-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
- name: run basic test
shell: bash
run: |
sudo bash build.sh init
echo "begin test..."
python3 test/case/miniob_test.py --test-cases=basic | tail -1 | grep "basic is success"
# I found that sysbench would send more request before receiving last response
sysbench-test:
strategy:
matrix:
thread_model: ['one-thread-per-connection', 'java-thread-pool']
test_case: ['miniob_insert', 'miniob_delete', 'miniob_select']
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
- name: install sysbench and mariadb-client
shell: bash
run: |
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh -o script.deb.sh
sudo bash script.deb.sh
sudo apt -y install sysbench mariadb-client
- name: build miniob
shell: bash
run: |
sudo bash build.sh init
bash build.sh release -DCONCURRENCY=ON -DWITH_UNIT_TESTS=OFF
- name: start server
shell: bash
run: |
nohup ./build_release/bin/observer -T ${{ matrix.thread_model }} -s /tmp/miniob.sock -f etc/observer.ini -P mysql -t mvcc -d disk &
sleep 10 && echo "wake up"
mysql --version
mysql -S /tmp/miniob.sock -e "show tables"
# error number 41 is LOCKED_CONCURRENCY_CONFLICT
# we should change the error number if we update the code
- name: sysbench test
shell: bash
run: |
cd test/sysbench
sysbench --mysql-socket=/tmp/miniob.sock --mysql-ignore-errors=41 --threads=10 ${{ matrix.test_case }} prepare
sysbench --mysql-socket=/tmp/miniob.sock --mysql-ignore-errors=41 --threads=10 ${{ matrix.test_case }} run
- name: stop server
shell: bash
run: |
mysql -S /tmp/miniob.sock -e "create table t(id int)"
mysql -S /tmp/miniob.sock -e "show tables"
killall observer
- name: restart server
shell: bash
run: |
nohup ./build_release/bin/observer -T ${{ matrix.thread_model }} -s /tmp/miniob.sock -f etc/observer.ini -P mysql -t mvcc -d disk &
sleep 10 && echo "wake up"
mysql -S /tmp/miniob.sock -e "show tables"
- name: sysbench test again
shell: bash
run: |
cd test/sysbench
sysbench --mysql-socket=/tmp/miniob.sock --mysql-ignore-errors=41 --threads=10 ${{ matrix.test_case }} run
benchmark-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
- name: build observer and benchmark
shell: bash
run: |
sudo bash build.sh init
bash build.sh release -DCONCURRENCY=ON -DWITH_UNIT_TESTS=OFF -DWITH_BENCHMARK=ON
- name: concurrency-test
shell: bash
run: |
cd build_release/bin/
for file in `find ./ -name "*_concurrency_test" -executable`; do $file; if [ $? -ne 0 ]; then exit 1; fi; done
memtracer-test:
strategy:
matrix:
memtracer: ['LD_PRELOAD=./lib/libmemtracer.so', '']
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
- name: build
shell: bash
run: |
sudo bash build.sh init
bash build.sh release -DWITH_BENCHMARK=ON -DENABLE_ASAN=OFF -DCONCURRENCY=ON -DWITH_MEMTRACER=ON
- name: memtracer-performance-test
shell: bash
run: |
cd build_release
${{matrix.memtracer}} ./bin/memtracer_performance_test
- name: memtracer-unittest
shell: bash
run: |
cd build_release
LD_PRELOAD=./lib/libmemtracer.so ./bin/memtracer_test
- name: memtracer-sysbench
shell: bash
run: |
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh -o script.deb.sh
sudo bash script.deb.sh
sudo apt -y install sysbench mariadb-client
nohup sh -c '${{matrix.memtracer}} ./build_release/bin/observer -T one-thread-per-connection -s /tmp/miniob.sock -f etc/observer.ini -P mysql -t mvcc -d disk' &
sleep 10 && echo "wake up"
mysql --version
mysql -S /tmp/miniob.sock -e "show tables"
cd test/sysbench
sysbench --mysql-socket=/tmp/miniob.sock --mysql-ignore-errors=41 --threads=10 miniob_insert prepare
sysbench --mysql-socket=/tmp/miniob.sock --mysql-ignore-errors=41 --threads=10 miniob_insert run
killall observer
cd ../..
nohup ./build_release/bin/observer -T one-thread-per-connection -s /tmp/miniob.sock -f etc/observer.ini -P mysql -t mvcc -d disk &
sleep 10 && echo "wake up"
mysql -S /tmp/miniob.sock -e "show tables"