diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py
index 6ddc4d29bc5da03e7de203c79155df24c1b40577..fb3632e4adf6ae9ff6ee72754194ec19e746053d 100755
--- a/tools/run_tests/jobset.py
+++ b/tools/run_tests/jobset.py
@@ -133,7 +133,7 @@ class JobSpec(object):
   """Specifies what to run for a job."""
 
   def __init__(self, cmdline, shortname=None, environ=None, hash_targets=None,
-               cwd=None, shell=False, timeout_seconds=5*60, flake_retries=5):
+               cwd=None, shell=False, timeout_seconds=5*60, flake_retries=0):
     """
     Arguments:
       cmdline: a list of arguments to pass as the command line
diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index 35c1672fefb8d9ba1df0ed77139f89c521305817..cbbb58d7e72fd393ff04aba27ee18edcd4a19a74 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -100,7 +100,8 @@ class SimpleConfig(object):
                           environ=actual_environ,
                           timeout_seconds=self.timeout_seconds,
                           hash_targets=hash_targets
-                              if self.allow_hashing else None)
+                              if self.allow_hashing else None,
+                          flake_retries=5 if args.allow_flakes else 0)
 
 
 # ValgrindConfig: compile with some CONFIG=config, but use valgrind to run
@@ -118,7 +119,8 @@ class ValgrindConfig(object):
     return jobset.JobSpec(cmdline=['valgrind', '--tool=%s' % self.tool] +
                           self.args + cmdline,
                           shortname='valgrind %s' % cmdline[0],
-                          hash_targets=None)
+                          hash_targets=None,
+                          flake_retries=5 if args.allow_flakes else 0)
 
 
 def get_c_tests(travis, test_lang) :
@@ -556,6 +558,11 @@ argp.add_argument('--use_docker',
                   help="Run all the tests under docker. That provides " +
                   "additional isolation and prevents the need to installs " +
                   "language specific prerequisites. Only available on Linux.")
+argp.add_argument('--allow_flakes',
+                  default=False,
+                  action='store_const',
+                  const=True,
+                  help="Allow flaky tests to show as passing (re-runs failed tests up to five times)")
 argp.add_argument('-a', '--antagonists', default=0, type=int)
 argp.add_argument('-x', '--xml_report', default=None, type=str,
         help='Generates a JUnit-compatible XML report')