Skip to content

Doing a parallel load test #32

@begriffs

Description

@begriffs

A user discovered a problem in my web server that causes it to freeze under certain types of concurrent traffic. I'm trying to model the situation in a test but having trouble with the types.

import Control.Concurrent.Async (mapConcurrently)
-- ...

context "in parallel, contentiously" $ do
  it "does not crash the server" $ do
    liftIO $ mapConcurrently (
        const . void $ get "/foo"
      ) [1..100]
    get "/bar" `shouldRespondWith` 200

My problem is that once I'm inside of the concurrent map I'm in IO and I don't know how to get back into WaiSession in order to make a get request. Is it possible to do this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions