Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save cyberjso/f1bd985af6cc25ebe28178752b4ff310 to your computer and use it in GitHub Desktop.
Save cyberjso/f1bd985af6cc25ebe28178752b4ff310 to your computer and use it in GitHub Desktop.
Gatling: Hot fo fix: "java.net.ConnectException: Cannot assign requested address"?
  val httpConf = http
    .baseURL("http://IP:9200")
    .acceptHeader("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
    .doNotTrackHeader("1")
    .acceptLanguageHeader("en-US,en;q=0.5")
    .acceptEncodingHeader("gzip, deflate")
    .userAgentHeader("Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0")
    .shareConnections

pre-tunning: https://github.com/gatling/gatling/blob/master/src/sphinx/general/operations.rst

.shareConnections does the magic! https://groups.google.com/forum/#!topic/gatling/rRpv8LPa51I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment