Giter Club home page Giter Club logo

pitaya-bot's Introduction

Deprecation Notice

Pitaya-bot is no longer the recommended way to load test pitaya applications. We recommend using xk6-pitaya

pitaya-bot GoDoc Docs Go Report Card MIT licensed Build Status Coverage Status

Pitaya-Bot is an easy to use, fast and lightweight test server framework for Pitaya. The goal of pitaya-bot is to provide a basic development framework for testing pitaya servers via integration tests or stress tests.

Getting Started

Prerequisites

  • Go >= 1.10
  • etcd (optional: for running the testing example)
  • nats (optional: for running the testing example)
  • docker (optional: for running the testing example)

Installing

clone the repo

go get -u github.com/topfreegames/pitaya-bot

setup pitaya-bot dependencies

cd $GOPATH/src/github.com/topfreegames/pitaya-bot/
make setup

Running pitaya-bot

Here's how to run the testing example with JSON serializer:

Start the dependencies (this command requires docker-compose, but you may run the dependencies locally if need be) and the pitaya server:

$ make run-testing-json-server

Now a pitaya server should be running in one terminal. In another one, you can run pitaya-bot with the test specs:

$ make run-testing-json-bots

For the examples with protobuf, instead run:

$ make run-testing-proto-server
$ make run-testing-proto-bots

Running the tests

make test

Contributing

#TODO

Authors

  • TFG Co - Initial work

License

MIT License

Resources

pitaya-bot's People

Contributors

andrehp avatar caioicy avatar capella avatar felipejfc avatar henriqueoelze avatar henrod avatar rcmgleite avatar rodrigolck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pitaya-bot's Issues

When using protobuf there's a racing condition in one of the dependencies that's causing panics if numberOfInstances > 1

Stack trace:

fatal error: concurrent map writes
goroutine 157 [running]:
runtime.throw(0x212d93a, 0x15)
	/usr/local/Cellar/go/1.11.5/libexec/src/runtime/panic.go:608 +0x72 fp=0xc0005a1aa8 sp=0xc0005a1a78 pc=0x102ccc2
runtime.mapassign_fast32(0x1f52060, 0xc0003b8fc0, 0x2, 0x1)
	/usr/local/Cellar/go/1.11.5/libexec/src/runtime/map_fast32.go:172 +0x2e8 fp=0xc0005a1ae8 sp=0xc0005a1aa8 pc=0x1011da8
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.(*Message).internalSetField(0xc00023dd10, 0xc0000d8780, 0x1ed98c0, 0xc0000dc400)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/dynamic_message.go:731 +0xb2 fp=0xc0005a1b90 sp=0xc0005a1ae8 pc=0x1df94b2
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.(*Message).addRepeatedField(0xc00023dd10, 0xc0000d8780, 0x2118fc0, 0xc00023c090, 0x0, 0x0)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/dynamic_message.go:1613 +0x1a8 fp=0xc0005a1c30 sp=0xc0005a1b90 pc=0x1dfdc68
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.mergeField(0xc00023dd10, 0xc0000d8780, 0x2118fc0, 0xc00023c090, 0x0, 0x2118fc0)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/merge.go:93 +0x49b fp=0xc0005a1d28 sp=0xc0005a1c30 pc=0x1e1516b
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.(*Message).unmarshalKnownField(0xc00023dd10, 0xc0000d8780, 0xc0000d8702, 0xc0005a1e68, 0x0, 0x0)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/binary.go:609 +0xfd fp=0xc0005a1df8 sp=0xc0005a1d28 pc=0x1df3ead
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.(*Message).unmarshal(0xc00023dd10, 0xc0005a1e68, 0xc0005a1f00, 0xc000164000, 0x1013c86)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/binary.go:414 +0xa8 fp=0xc0005a1e40 sp=0xc0005a1df8 pc=0x1df2e68
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.(*Message).UnmarshalMerge(0xc00023dd10, 0xc0006b0000, 0x43f, 0x600, 0x1e232c9, 0xc00020a450)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/binary.go:390 +0x77 fp=0xc0005a1e98 sp=0xc0005a1e40 pc=0x1df2d87
github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic.(*Message).Unmarshal(0xc00023dd10, 0xc0006b0000, 0x43f, 0x600, 0x2f61e60, 0x0)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/jhump/protoreflect/dynamic/binary.go:379 +0x5f fp=0xc0005a1ed8 sp=0xc0005a1e98 pc=0x1df2c8f
github.com/topfreegames/pitaya-bot/vendor/github.com/topfreegames/pitaya/client.(*ProtoClient).waitForData(0xc00002c0e0)
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/topfreegames/pitaya/client/protoclient.go:382 +0x176 fp=0xc0005a1fd8 sp=0xc0005a1ed8 pc=0x1e23166
runtime.goexit()
	/usr/local/Cellar/go/1.11.5/libexec/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc0005a1fe0 sp=0xc0005a1fd8 pc=0x105a0b1
created by github.com/topfreegames/pitaya-bot/vendor/github.com/topfreegames/pitaya/client.(*ProtoClient).ConnectTo
	/Users/felipejfc/dev/go/src/github.com/topfreegames/pitaya-bot/vendor/github.com/topfreegames/pitaya/client/protoclient.go:439 +0x9d

pitaya-bot v2.0.1 json demo bug

time="2022-06-28T18:28:37+08:00" level=fatal msg="Invalid handshake." app=pitaya-bot botId=0 function=run source=pitaya-bot spec="specs\default.json"

Debugger finished with the exit code 0

How to use custom protobuf serializer?

If I use the new custom serializer on the server

// I did encryption and decryption in the NewCustomSerializer
pitaya.SetSerializer(tfprotos.NewCustomSerializer())

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.