Aborting the connection while negotiating should reject the deferred #2340

Closed
NTaylorMullen opened this Issue Jul 25, 2013 · 2 comments

Comments

Projects
None yet
3 participants
Contributor

NTaylorMullen commented Jul 25, 2013

Currently the deferred object just hangs, we should abort it.

@ghost ghost assigned NTaylorMullen Jul 25, 2013

NTaylorMullen added a commit that referenced this issue Jul 25, 2013

NTaylorMullen added a commit that referenced this issue Jul 25, 2013

Contributor

gustavo-armenta commented Jul 31, 2013

test should validate error message on start.fail() is "Stopped the connection while negotiating." or at least do some kind of assert.ok() to ensure the deferred is invoked

QUnit.asyncTimeoutTest(transport + ": Connections can be started and stopped repeatedly without errors.", testUtilities.defaultTestTimeout, function (end, assert, testName) {
        var restartCount = 3,
            connection = testUtilities.createHubConnection(end, assert, testName, undefined, false);

        connection.error(function () {
            assert.fail("Error was triggered.");
        });

        for (var i = 0; i < restartCount; i++) {
            connection.start({ transport: transport }).done(function () {
                assert.fail("Connection started");
                end();
            }).fail(function () {
                assert.comment("Fail handler was triggered on aborted negotiate.");
            });

            connection.stop();
        }

        window.setTimeout(function () {
            assert.equal(connection.state, $.signalR.connectionState.disconnected, "Connection is disconnected.");
            assert.equal(connection.transport, null, "Transport was not instantiated and is cleared.");
            end();
        }, 3000);

        // Cleanup
        return function () {
            connection.stop();
        };
    });

@ghost ghost assigned gustavo-armenta Jul 31, 2013

Contributor

gustavo-armenta commented Jul 31, 2013

automated test is doing verification

@davidfowl davidfowl reopened this Aug 20, 2013

@davidfowl davidfowl closed this Aug 20, 2013

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