Bug 1269501: Follow-up: Fix more win32 bustage that wasn't in the last try run. r=bustage
authorKris Maglione <maglione.k@gmail.com>
Fri, 27 May 2016 16:14:25 -0700
changeset 338312 1bd815acf6d3d51ded73a0ffbe05bd8a2c515784
parent 338311 b094e88c2184607005c0ce50b6eca797bc50de0a
child 338313 2e2c3435f648e36080c49c46416b710e0b52d55a
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1269501
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1269501: Follow-up: Fix more win32 bustage that wasn't in the last try run. r=bustage MozReview-Commit-ID: 1q2pivuzfKr
toolkit/modules/subprocess/subprocess_worker_win.js
toolkit/modules/subprocess/test/xpcshell/data_test_script.py
toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
--- a/toolkit/modules/subprocess/subprocess_worker_win.js
+++ b/toolkit/modules/subprocess/subprocess_worker_win.js
@@ -83,17 +83,17 @@ class Pipe extends BasePipe {
     this.pending.length = 0;
 
     this.buffer = null;
 
     if (!this.closed) {
       this.handle.dispose();
       this._event.dispose();
 
-      io.pipes.delete(this.handle);
+      io.pipes.delete(this.id);
 
       this.handle = null;
       this.closed = true;
       this.resolveClosed();
 
       io.updatePollEvents();
     }
     return this.closedPromise;
--- a/toolkit/modules/subprocess/test/xpcshell/data_test_script.py
+++ b/toolkit/modules/subprocess/test/xpcshell/data_test_script.py
@@ -17,16 +17,21 @@ def echo_loop():
     while True:
         line = sys.stdin.readline()
         if not line:
             break
 
         output(line)
 
 
+if sys.platform == "win32":
+    import msvcrt
+    msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
+
+
 cmd = sys.argv[1]
 if cmd == 'echo':
     echo_loop()
 elif cmd == 'exit':
     sys.exit(int(sys.argv[2]))
 elif cmd == 'env':
     for var in sys.argv[2:]:
         output(os.environ.get(var, ''))
@@ -35,12 +40,16 @@ elif cmd == 'pwd':
 elif cmd == 'print_args':
     for arg in sys.argv[2:]:
         output(arg)
 elif cmd == 'ignore_sigterm':
     signal.signal(signal.SIGTERM, signal.SIG_IGN)
 
     output('Ready')
     while True:
-        signal.pause()
+        try:
+            signal.pause()
+        except AttributeError:
+            import time
+            time.sleep(3600)
 elif cmd == 'print':
     sys.stdout.write(sys.argv[2])
     sys.stderr.write(sys.argv[3])
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
+++ b/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
@@ -429,17 +429,17 @@ add_task(function* test_subprocess_pathS
   let promise = Subprocess.call({
     command: PYTHON_BIN,
     arguments: ["-u", TEST_SCRIPT, "exit", "13"],
     environment: {
       PATH: PYTHON_DIR,
     },
   });
 
-  Assert.rejects(
+  yield Assert.rejects(
     promise,
     function(error) {
       return error.errorCode == Subprocess.ERROR_BAD_EXECUTABLE;
     },
     "Subprocess.call should fail for a bad executable");
 });
 
 
@@ -636,30 +636,33 @@ add_task(function* test_bad_executable()
 
   let textFile = do_get_file("data_text_file.txt").path;
 
   let promise = Subprocess.call({
     command: textFile,
     arguments: [],
   });
 
-  Assert.rejects(
+  yield Assert.rejects(
     promise,
     function(error) {
+      if (AppConstants.platform == "win") {
+        return /Failed to create process/.test(error.message);
+      }
       return error.errorCode == Subprocess.ERROR_BAD_EXECUTABLE;
     },
     "Subprocess.call should fail for a bad executable");
 
   // Test with a nonexistent file.
   promise = Subprocess.call({
     command: textFile + ".doesNotExist",
     arguments: [],
   });
 
-  Assert.rejects(
+  yield Assert.rejects(
     promise,
     function(error) {
       return error.errorCode == Subprocess.ERROR_BAD_EXECUTABLE;
     },
     "Subprocess.call should fail for a bad executable");
 });