File flaky_test_rerun.patch of Package nodejs8.15384

Index: node-v8.12.0/tools/test.py
===================================================================
--- node-v8.12.0.orig/tools/test.py
+++ node-v8.12.0/tools/test.py
@@ -512,11 +512,17 @@ class TestCase(object):
 
   def RunCommand(self, command, env):
     full_command = self.context.processor(command)
-    output = Execute(full_command,
+    reruns = 0
+    while(reruns < 5):
+      reruns += 1
+      output = Execute(full_command,
                      self.context,
                      self.context.GetTimeout(self.mode),
                      env,
                      disable_core_files = self.disable_core_files)
+      if output.exit_code == 0:
+        break;
+      print("FLAKY rerun: ", command)
     self.Cleanup()
     return TestOutput(self,
                       full_command,