Browse Source

[SauceLabs] Quit browser when there is an error.
It fixes the case:
When there is an error in browser instance A, another browser instance B will be launched for retrying the test.
The test passed in B. But A is still running and eventually timeout and being marked as error. The whole test will mark as fail although B passed.

Andy Li 10 years ago
parent
commit
83205252f7
1 changed files with 6 additions and 4 deletions
  1. 6 4
      tests/unit/src/RunSauceLabs.hx

+ 6 - 4
tests/unit/src/RunSauceLabs.hx

@@ -111,10 +111,12 @@ class RunSauceLabs {
 					function handleError(err:String, ?pos:haxe.PosInfos):Bool {
 						if (err != null) {
 							console.log('${pos.fileName}:${pos.lineNumber}: $err');
-							if (retries > 0)
-								testBrowser(caps, retries - 1);
-							else
-								throw err;
+							browser.quit(function(err) {
+								if (retries > 0)
+									testBrowser(caps, retries - 1);
+								else
+									throw err;
+							});
 							return false;
 						}
 						return true;