Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test_game stress test #102

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
85 changes: 85 additions & 0 deletions .github/res/goworld_stress.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[debug]
debug = 1 ; set to 0 in production

[deployment]
desired_dispatchers=100
desired_games=200
desired_gates=400

[storage]
type=mongodb
url=mongodb://127.0.0.1:27017/
db=goworld

[kvdb]
type=mongodb
url=mongodb://127.0.0.1:27017/goworld
db=goworld
collection=__kv__
;type=redis
;url=redis://127.0.0.1:6379
;db=1
;type=redis_cluster
;start_nodes_1=127.0.0.1:6379
;start_nodes_2=127.0.0.2:6379

[dispatcher_common]
listen_addr=127.0.0.1:13000
advertise_addr=127.0.0.1:13000
http_addr=127.0.0.1:23000
log_file=dispatcher.log
log_stderr=true
log_level=debug

[dispatcher1]
listen_addr=127.0.0.1:13001
advertise_addr=127.0.0.1:13001
http_addr=127.0.0.1:23001
[dispatcher2]
listen_addr=127.0.0.1:13002
advertise_addr=127.0.0.1:13002
http_addr=127.0.0.1:23002

[game_common]
boot_entity=Account
save_interval=600
log_file=game.log
log_stderr=true
http_addr=127.0.0.1:25000
log_level=debug
position_sync_interval_ms=100 ; position sync: server -> client
; gomaxprocs=0

[game1]
http_addr=25001
; ban_boot_entity=false
[game2]
http_addr=25002
;ban_boot_entity=false
;[game3]
;http_addr=25003
;;ban_boot_entity=false

[gate_common]
; gomaxprocs=0
log_file=gate.log
log_stderr=true
http_addr=127.0.0.1:24000
listen_addr=0.0.0.0:14000
log_level=debug
compress_connection=1
encrypt_connection=1
rsa_key=rsa.key
rsa_certificate=rsa.crt
heartbeat_check_interval = 0
position_sync_interval_ms=100 ; position sync: client -> server

[gate1]
listen_addr=0.0.0.0:14001
http_addr=127.0.0.1:24001
[gate2]
listen_addr=0.0.0.0:14002
http_addr=127.0.0.1:24002
;[gate3]
;listen_addr=0.0.0.0:14003
;http_addr=127.0.0.1:24003
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v2
- name: Test
run: |
cp goworld_actions.ini goworld.ini
cp .github/res/goworld.ini goworld.ini
bash covertest.sh
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
4 changes: 2 additions & 2 deletions .github/workflows/test_game.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [1.11, 1.14]
go: [1.14]
os: ["ubuntu-18.04"]
mongodb-version: [3.6]
steps:
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v2
- name: Test Game
run: |
cp goworld_actions.ini goworld.ini
cp .github/res/goworld.ini goworld.ini
go get ./cmd/...
goworld build examples/test_client
goworld build examples/test_game
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test_game_stress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test Game (Stress)

on: [ pull_request ]

jobs:
cancel-previous-runs:
runs-on: ubuntu-18.04
steps:
- uses: rokroskar/workflow-run-cleanup-action@master
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "github.ref != 'refs/heads/master'"

test_game:
name: Test Game (Go ${{ matrix.go }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: [1.14]
os: ["ubuntu-18.04"]
mongodb-version: [3.6]
steps:
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: ${{ matrix.mongodb-version }}
- uses: shogo82148/actions-setup-redis@v1
with:
redis-version: '4.x'
- uses: actions/checkout@v2
- name: Test Game (Stress)
run: |
cp .github/res/goworld_stress.ini goworld.ini
go get ./cmd/...
goworld build examples/test_client
goworld build examples/test_game
goworld start examples/test_game
sleep 5
examples/test_client/test_client -N 200 -strict -duration 300
sleep 5
goworld reload examples/test_game
sleep 5
examples/test_client/test_client -N 200 -strict -duration 60
sleep 1
goworld stop examples/test_game