mustafa5253 / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Timeout in Async test on Opera 12.11 #416

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. AJAX async call test for  20 test cases
2. The execution order is one by one 
3. When execution of 7 test cases finished, the test case running hang.  

function sendOutTests(testCase, extData, queue) {   

    var xhr = getXMLHTTPObject();
    var query = "TC=" + testCase + "_JavaScript";

    var getURL = "http://127.0.0.1:10008/test?" + query;

    xhr.open('GET', getURL, true);
    var testResult;
    queue.call("Step 1: send a request to the server and save the response body", function(callbacks) {  
        var onBodyReceived = callbacks.add(function(body) {
            testResult = body;
        });
//          
        xhr.onreadystatechange = function() {
            if (xhr.readyState == 4) { // full body received
               testResult = xhr.responseText;
               onBodyReceived(xhr.responseText);
            }
        };
        xhr.send(null);
     });

     queue.call('Step 2: then assert test result', function() {
         assertEquals("Test Failed", "true", testResult);
     });
}

What is the expected output? What do you see instead?
20 test cases should be executed one by one until the test finished. 

But the tests hang after 7 test cases finished.  Timeout exception thrown 
queue.call("Step 1:...)

What version of the product are you using? On what operating system?
1.3.5, 1.3.4-b 
Windows 7 + Opera 12.11

Please provide any additional information below.

Original issue reported on code.google.com by Josseph....@gmail.com on 13 Dec 2012 at 7:24