Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: tools/run-tests.py

Issue 1866953002: [test] Rework how default timeout is handled. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2012 the V8 project authors. All rights reserved. 3 # Copyright 2012 the V8 project authors. All rights reserved.
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 dest="dont_skip_simulator_slow_tests") 330 dest="dont_skip_simulator_slow_tests")
331 result.add_option("--stress-only", 331 result.add_option("--stress-only",
332 help="Only run tests with --always-opt --stress-opt", 332 help="Only run tests with --always-opt --stress-opt",
333 default=False, action="store_true") 333 default=False, action="store_true")
334 result.add_option("--swarming", 334 result.add_option("--swarming",
335 help="Indicates running test driver on swarming.", 335 help="Indicates running test driver on swarming.",
336 default=False, action="store_true") 336 default=False, action="store_true")
337 result.add_option("--time", help="Print timing information after running", 337 result.add_option("--time", help="Print timing information after running",
338 default=False, action="store_true") 338 default=False, action="store_true")
339 result.add_option("-t", "--timeout", help="Timeout in seconds", 339 result.add_option("-t", "--timeout", help="Timeout in seconds",
340 default= -1, type="int") 340 default=TIMEOUT_DEFAULT, type="int")
341 result.add_option("--tsan", 341 result.add_option("--tsan",
342 help="Regard test expectations for TSAN", 342 help="Regard test expectations for TSAN",
343 default=False, action="store_true") 343 default=False, action="store_true")
344 result.add_option("-v", "--verbose", help="Verbose output", 344 result.add_option("-v", "--verbose", help="Verbose output",
345 default=False, action="store_true") 345 default=False, action="store_true")
346 result.add_option("--valgrind", help="Run tests through valgrind", 346 result.add_option("--valgrind", help="Run tests through valgrind",
347 default=False, action="store_true") 347 default=False, action="store_true")
348 result.add_option("--warn-unused", help="Report unused rules", 348 result.add_option("--warn-unused", help="Report unused rules",
349 default=False, action="store_true") 349 default=False, action="store_true")
350 result.add_option("--junitout", help="File name of the JUnit output") 350 result.add_option("--junitout", help="File name of the JUnit output")
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
658 shell_dir = os.path.join( 658 shell_dir = os.path.join(
659 BASE_DIR, 659 BASE_DIR,
660 options.outdir, 660 options.outdir,
661 "%s.%s" % (arch, MODES[mode]["output_folder"]), 661 "%s.%s" % (arch, MODES[mode]["output_folder"]),
662 ) 662 )
663 if not os.path.exists(shell_dir): 663 if not os.path.exists(shell_dir):
664 raise Exception('Could not find shell_dir: "%s"' % shell_dir) 664 raise Exception('Could not find shell_dir: "%s"' % shell_dir)
665 665
666 # Populate context object. 666 # Populate context object.
667 mode_flags = MODES[mode]["flags"] 667 mode_flags = MODES[mode]["flags"]
668 timeout = options.timeout
669 if timeout == -1:
670 # Simulators are slow, therefore allow a longer default timeout.
671 if arch in SLOW_ARCHS:
672 timeout = 2 * TIMEOUT_DEFAULT;
673 else:
674 timeout = TIMEOUT_DEFAULT;
675 668
676 timeout *= MODES[mode]["timeout_scalefactor"] 669 # Simulators are slow, therefore allow a longer timeout.
670 if arch in SLOW_ARCHS:
671 options.timeout *= 2
672
673 options.timeout *= MODES[mode]["timeout_scalefactor"]
677 674
678 if options.predictable: 675 if options.predictable:
679 # Predictable mode is slower. 676 # Predictable mode is slower.
680 timeout *= 2 677 options.timeout *= 2
681 678
682 # TODO(machenbach): Remove temporary verbose output on windows after 679 # TODO(machenbach): Remove temporary verbose output on windows after
683 # debugging driver-hung-up on XP. 680 # debugging driver-hung-up on XP.
684 verbose_output = ( 681 verbose_output = (
685 options.verbose or 682 options.verbose or
686 utils.IsWindows() and options.progress == "verbose" 683 utils.IsWindows() and options.progress == "verbose"
687 ) 684 )
688 ctx = context.Context(arch, MODES[mode]["execution_mode"], shell_dir, 685 ctx = context.Context(arch, MODES[mode]["execution_mode"], shell_dir,
689 mode_flags, verbose_output, 686 mode_flags, verbose_output,
690 timeout, options.isolates, 687 options.timeout,
688 options.isolates,
691 options.command_prefix, 689 options.command_prefix,
692 options.extra_flags, 690 options.extra_flags,
693 options.no_i18n, 691 options.no_i18n,
694 options.random_seed, 692 options.random_seed,
695 options.no_sorting, 693 options.no_sorting,
696 options.rerun_failures_count, 694 options.rerun_failures_count,
697 options.rerun_failures_max, 695 options.rerun_failures_max,
698 options.predictable, 696 options.predictable,
699 options.no_harness, 697 options.no_harness,
700 use_perf_data=not options.swarming, 698 use_perf_data=not options.swarming,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 "--coverage-dir=%s" % options.sancov_dir]) 833 "--coverage-dir=%s" % options.sancov_dir])
836 except: 834 except:
837 print >> sys.stderr, "Error: Merging sancov files failed." 835 print >> sys.stderr, "Error: Merging sancov files failed."
838 exit_code = 1 836 exit_code = 1
839 837
840 return exit_code 838 return exit_code
841 839
842 840
843 if __name__ == "__main__": 841 if __name__ == "__main__":
844 sys.exit(Main()) 842 sys.exit(Main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698