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

[wiki]How to run tests #95

Closed
sonyafenge opened this issue Jul 20, 2022 · 2 comments
Closed

[wiki]How to run tests #95

sonyafenge opened this issue Jul 20, 2022 · 2 comments

Comments

@sonyafenge
Copy link
Collaborator

sonyafenge commented Jul 20, 2022

Automatically start testing

export GRS_INSTANCE_PREFIX=[yourPreferName]-grs AUTORUN_E2E=true SIM_NUM=5 CLIENT_NUM=1 SERVER_NUM=1
export SERVER_ZONE=us-central1-a   SIM_ZONE=us-central1-a,us-west1-c,us-west2-a,us-west4-a,us-west3-c CLIENT_ZONE=us-central1-a
export SIM_REGIONS="Beijing,Shanghai,Wulan,Guizhou,Reserved1" SIM_RP_NUM=10 NODES_PER_RP=20000 SCHEDULER_REQUEST_MACHINE=25000 SCHEDULER_REQUEST_LIMIT=26000 SCHEDULER_NUM=10
export SERVICE_EXTRA_ARGS="--enable_metrics=false"
./hack/test-setup.sh

Collect logs

run on dev machines

set any log env if different with default, and run test-logcollect.sh

by default, all logs copy to machine: sonyadev4:~/grs/logs/${SERVER_NUM}se${SIM_NUM}si${CLIENT_NUM}cl

DIR_ROOT=${DIR_ROOT:-"~"}
SIM_LOG_DIR=${SIM_LOG_DIR:-"${DIR_ROOT}/logs"}
SERVER_LOG_DIR=${SERVER_LOG_DIR:-"${DIR_ROOT}/logs"}
CLIENT_LOG_DIR=${CLIENT_LOG_DIR:-"${DIR_ROOT}/logs"}
DES_LOG_DIR=${DES_LOG_DIR:-"${DIR_ROOT}/grs/logs/${SERVER_NUM}se${SIM_NUM}si${CLIENT_NUM}cl"}
DES_LOG_INSTANCE=${DES_LOG_INSTANCE:-"sonyadev4"}
DES_LOG_INSTANCE_ZONE=${DES_LOG_INSTANCE_ZONE:-"us-central1-a"}
./hack/test-logcollect.sh

Manually start testing

Start service

run on server machine: ${GRS_INSTANCE_PREFIX}-server

master_ip can be instance name or internal IP, cannot be external IP

$ go run resource-management/cmds/service-api/service-api.go --master_ip=sonya1-grs-server-us-central1-a-mig-d8sh --resource_urls=34.122.89.43:9119,34.105.19.247:9119,35.236.3.51:9119,34.125.168.129:9119,34.106.129.28:9119 --enable_metrics=false -v=9 > ~/logs/service.log.2022-07-21.v000056 2>&1 &

Start simulator

run on simulator machine: ${GRS_INSTANCE_PREFIX}-sim

each simulator should have different "region_name". available "region_name":

        Beijing   
	Shanghai  
	Wulan     
	Guizhou   
	Reserved1 
	Reserved2 
	Reserved3 
	Reserved4 
	Reserved5 
$ go run resource-management/test/resourceRegionMgrSimulator/main.go --region_name=Beijing --rp_num=10 --nodes_per_rp=20000 --master_port=9119 -v=6 > ~/logs/simulator.1.log.2022-07-21.v000056 2>&1 &

Run e2e testing

run on client machines: ${GRS_INSTANCE_PREFIX}-client

service_url need to be server's publicIP:8080

$ for i in {1..14}; do sleep 1; go run resource-management/test/e2e/singleClientTest.go --service_url=34.172.122.124:8080 --request_machines=25000 --action=watch --repeats=1 --limit=26000 -v=6 > ~/logs/scheduler.6.$i.log.2022-07-21.v000056 2>&1 & done
@yb01
Copy link
Collaborator

yb01 commented Jul 27, 2022

to run test on local dev machines:

pkill -f service-api 
pkill -f main
pkill -f singleClientTest

redis-cli flushall

go build cmds/service-api/service-api.go 
go build test/resourceRegionMgrSimulator/main.go
go build test/e2e/singleClientTest.go 

./main --rp_num=1 --nodes_per_rp=25000 -v=6 > sim.log 2>&1 &
./service-api -resource_urls=localhost:9119 -v=3 --enable_metrics=false > t.log 2>&1 &
./singleClientTest -v=6 --request_machines=25000 --limit=26000 > c.log 2>&1 &

@yb01
Copy link
Collaborator

yb01 commented Aug 8, 2022

in md doc now

@yb01 yb01 closed this as completed Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants