@Test
    public void requestBlocksWhenPollResponseOutstanding() throws Exception {
        logTestStart();
        // Client response to 'requests' attribute value of '1' in CM resp
        session.send(ComposableBody.builder().build());
        StubConnection conn = cm.awaitConnection();
        AbstractBody scr = getSessionCreationResponse(conn.getRequest().getBody())
                .setAttribute(Attributes.WAIT, "0")
                .setAttribute(Attributes.REQUESTS, "1")
                .build();
        conn.sendResponse(scr);
        session.drain();

        // Verify the CM params got picked up correctly
        CMSessionParams params = session.getCMSessionParams();
        AttrRequests aReq = params.getRequests();
        assertNotNull(aReq);
        assertEquals(1, aReq.intValue());

        // Establish the one allowed connection
        final ComposableBody resp = ComposableBody.builder()
            .setAttribute(Attributes.SID, scr.getAttribute(Attributes.SID))
            .build();
        session.send(ComposableBody.builder()
                .setNamespaceDefinition("foo", "http://127.0.0.1/")
                .setPayloadXML("<foo:bar/>")
                .build());
        StubConnection conn1 = cm.awaitConnection();

        // Set up a thread to send another request
        final AtomicBoolean completed = new AtomicBoolean();
        final Thread thr = new Thread(new Runnable() {
            public void run() {
                try {
                    session.send(ComposableBody.builder().build());
                    StubConnection conn2 = cm.awaitConnection();
                    conn2.sendResponse(resp);
                } catch (Throwable thr) {
                    // Ignore.  It will register as a failure anyhow.
                } finally {
                    completed.set(true);
                }
            }
        });

        // Run the other thread and make sure it blocks
        boolean pass = false;
        try {
            thr.start();
            try {
                // If we havent completed after 1.5 seconds, that's good
                Thread.sleep(1500);
                pass = thr.isAlive();
            } catch (InterruptedException intx) {
                // Not expected
            }
        } finally {
            thr.interrupt();
        }

        // Cleanup
        conn1.sendResponse(resp);

        assertTrue("Did not block until response was given", pass);
        assertValidators(scr);
    }