Skip to content

Race condition detection with a real world reverse proxy written in GO

License

Notifications You must be signed in to change notification settings

pavisalavisa/race-condition-detection

Repository files navigation

Race condition detection

Race condition detection with a real world reverse proxy written in GO.

blog post

This repo has two main branches

  • before - with race condition defect
  • after - without race condition

Check out the blog post here.

👟 How to run

Prerequisites:

  • Docker - Your favourite container platform
  • go - An open-source programming language supported by Google
  • k6 - The best developer experience for load testing

Run the following command to spin up the system using docker compose

$ docker-compose up --build -d 

The reverse proxy is reachable on port 8080

$ curl -X POST localhost:8080/a/foo/bar

🧪 Testing

To run the tests execute the following command

$ go test

If you want to enable race detector tool add the -race flag

$ go test -race

🪨 Load testing

While the system is running, execute the following command to start the load test

$ k6 run --vus 10 --iterations 1000 load-test.js

This command will execute the load-test.js script with 1000 iterations and 10 virual users.

🎞️ Rendering terminal GIFs

Make sure you have terminalizer on your system.

Run the following command to render the terminal recordings:

$ terminalizer render docs/<file_name>.yml

About

Race condition detection with a real world reverse proxy written in GO

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published