Giter Club home page Giter Club logo

microservice-test-bed's Introduction

microservice-test-bed

# install deps
npm i

# start svc and bff
npm start -w @mstb/svc
npm start -w @mstb/bff

# run test
npm start -w @mstb/cli

# run netstat to check the socket state
netstat -aon | find "9090"

Mock transient TCP state

FIN_WAIT_1 is a transient state at network/OS level. We'll need special utilities to mock it properly:

  • iptable on Linux (not sure how to yet)
  • clumsy on Windows

FIN_WAIT_2 would need java backend or net.server in nodeJS with allowHalfOpen set to true (index_net.js).

  • In windows FIN_WAIT_2/CLOSE_WAIT will be recycled by OS automatically after couple of minutes.

Usage for clumsy

  • Run step above to hit /fin_wait_1 endpoint.
  • After the 200 state prints, before the timeout is over, go to clumsy and start the blocking rule.
  • Go to prompt and run netstat -aon | find "9090" to we should see the expect incorrect state.
    • Rule tcp.Ack==1 and tcp.SrcPort=9090 will mock FIN_WAIT_1/ESTABLISHED state.
    • Rule tcp.Fin==1 and tcp.DstPort==9090 will mock FIN_WAIT_1/LAST_ACK state.
      • It will be hard to get FIN_WAIT_1/CLOSE_WAIT state as CLOSE_WAIT->LAST_ACK is done automatically by OOTB lib or OS.
    • For what is allowed in the tcp filter, see here.

microservice-test-bed's People

Contributors

jesse23 avatar

Watchers

 avatar

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.