"Players" are backends (Django) and load balancer that proxies all user requests on one of the backends.
In my case load balancer has small backend timeout (default is 3 sec, preferable is 1 sec) and it will send the same request (with the same X-Request-Id header) to another backend after this small timeout.
Some requests may take a long time to process (well, longer than 1 sec), so backends should not try to process requests that are being processed by other backends (they actually return "HTTP 202 Accepted" instead).
For testing purposes I have '/slow/<time>' view that takes exactly <time> seconds to process.
What I want to do is this:
1. Use django.test.client.Client to send request with small timeout (like load balancer will do) and make assertion, that TimeoutError is raised.
2. Send same request again and make assertion, that backend responded with "HTTP 202 Accepted".
3. Wait for some time (<time> seconds to be sure, that request has been processed by first backend) and send same request again and make final assertion, that backend responded with "HTTP 200 OK".
In my case backends are synchronised through distributed cache, so it doesn't matter which backend accepts each request, response will be the same.
I do realise, that this can be accomplished by just firing up "manage.py runserver" and sending requests as real load balancer would do, but I think it's too much overhead for a simple test.
By "prototype" you mean pull-request to Django with django.test.client.Client that supports 'timeout' argument, right?