Changeset 271179 in webkit
- Timestamp:
- Jan 5, 2021, 3:14:21 PM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
Scripts/run-jsc-stress-tests (modified) (7 diffs)
-
Scripts/webkitruby/jsc-stress-test-writer-default.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r271174 r271179 1 2021-01-05 Angelos Oikonomopoulos <angelos@igalia.com> 2 3 [JSC] allow stress tests to opt out of parallel execution 4 https://bugs.webkit.org/show_bug.cgi?id=213373 5 6 Reviewed by Yusuke Suzuki. 7 8 On memory-limited devices, some JSC stress tests may intermittently OOM when 9 they get scheduled along with another heavy JSC stress test. However, the tests 10 might be able to complete if run on their own. 11 12 This patch adds a serial! directive that causes a JSC stress test to only ever 13 be scheduled to run by itself. It's currently unused and needs to be enabled on 14 a test-by-test basis. 15 16 * Scripts/run-jsc-stress-tests: 17 * Scripts/webkitruby/jsc-stress-test-writer-default.rb: 18 1 19 2021-01-05 Ryan Haddad <ryanhaddad@apple.com> 2 20 -
trunk/Tools/Scripts/run-jsc-stress-tests
r270827 r271179 552 552 COLLECT_CONTINUOUSLY_OPTIONS = shouldCollectContinuously? ? ["--collectContinuously=true", "--useGenerationalGC=false"] : [] 553 553 554 $serialRunlist = [] 554 555 $runlist = [] 555 556 … … 619 620 errorHandler) 620 621 plan.additionalEnv.push(*additionalEnv) 622 if $runCommandOptions[:serial] 623 # Add this to the list of tests to be run on their own, so 624 # that we can treat them specially when scheduling, but keep 625 # it in the $runlist for code that dosn't care about 626 # scheduling. 627 $serialRunlist << plan 628 end 629 621 630 if $numChildProcesses > 1 and $runCommandOptions[:isSlow] 622 631 $runlist.unshift plan … … 668 677 $testSpecificRequiredOptions += ["-s"] 669 678 $runCommandOptions[:crashOK] = true 679 end 680 681 def serial! 682 $runCommandOptions[:serial] = true 670 683 end 671 684 … … 2390 2403 end 2391 2404 2392 def prepareGnuParallel TestRunner2393 path = $runnerDir + "parallel-tests"2405 def prepareGnuParallelRunnerJobs(name, runlist, exclude) 2406 path = $runnerDir + name 2394 2407 FileUtils.mkdir_p($runnerDir) 2395 2408 2396 2409 File.open(path, "w") { 2397 2410 | outp | 2398 $runlist.each {2411 runlist.each { 2399 2412 | plan | 2413 if exclude.has_key?(plan) 2414 next 2415 end 2400 2416 outp.puts("./test_script_#{plan.index}") 2401 2417 } 2402 2418 } 2419 end 2420 2421 def prepareGnuParallelTestRunner 2422 serialTests = {} 2423 $serialRunlist.each { |p| serialTests[p] = nil } 2424 prepareGnuParallelRunnerJobs("parallel-tests", $runlist, serialTests) 2425 prepareGnuParallelRunnerJobs("serial-tests", $serialRunlist, {}) 2403 2426 end 2404 2427 … … 2462 2485 end 2463 2486 2464 def runGnuParallelRunner 2465 inputs = $runnerDir + "parallel-tests" 2487 def runGnuParallelRunner(inputs, options={}) 2466 2488 timeout = 300 2467 2489 if ENV["JSCTEST_timeout"] 2468 2490 timeout = ENV["JSCTEST_timeout"].to_f.ceil.to_i 2491 end 2492 # We add 1 to make sure we always have waiting jobs and 2493 # don't run into stalls due to ssh latency. However, we 2494 # want to respect numChildProcesses, so we don't just use 2495 # the -j +1 GNU parallel idiom. 2496 parallelJobsOnEachHost = $numChildProcesses + 1 2497 if options[:parallelJobsOnEachHost] 2498 parallelJobsOnEachHost = options[:parallelJobsOnEachHost] 2469 2499 end 2470 2500 withGnuParallelSshLoginFile { … … 2472 2502 cmd = [ 2473 2503 "parallel", 2474 # We add 1 to make sure we always have waiting jobs and 2475 # don't run into stalls due to ssh latency. However, we 2476 # want to respect numChildProcesses, so we don't just use 2477 # the -j +1 GNU parallel idiom. 2478 "-j", "#{$numChildProcesses + 1}", 2504 "-j", "#{parallelJobsOnEachHost}", 2479 2505 "--retries 5", 2480 2506 "--line-buffer", # we know our output is line-oriented … … 2509 2535 raise "All remote hosts failed, giving up" 2510 2536 end 2511 runGnuParallelRunner 2537 runGnuParallelRunner($runnerDir + "serial-tests", 2538 { :parallelJobsOnEachHost => 1}) 2539 runGnuParallelRunner($runnerDir + "parallel-tests") 2512 2540 detectFailures 2513 2541 end -
trunk/Tools/Scripts/webkitruby/jsc-stress-test-writer-default.rb
r264391 r271179 306 306 end 307 307 308 def output_target(outp, plan, prereqs) 309 index = plan.index 310 target = "test_done_#{index}" 311 outp.puts "#{target}: #{prereqs.join(" ")}" 312 outp.puts "\tsh test_script_#{index}" 313 target 314 end 315 308 316 def prepareMakeTestRunner(remoteIndex) 309 317 # The goals of our parallel test runner are scalability and simplicity. The … … 311 319 # a full-time contributor just philosophising about parallel testing. 312 320 # 313 # As such, we just pass off all of the hard work to 'make'. This creates a 314 # dummy directory ("$outputDir/.runner") in which we create a dummy 315 # Makefile. The Makefile has an 'all' rule that depends on all of the tests. 316 # That is, for each test we know we will run, there is a rule in the 317 # Makefile and 'all' depends on it. Running 'make -j <whatever>' on this 318 # Makefile results in 'make' doing all of the hard work: 321 # As such, we just pass off all of the hard work to 'make'. This 322 # creates a dummy directory ("$outputDir/.runner") in which we 323 # create a dummy Makefile. The Makefile has a 'parallel' rule that 324 # depends all tests, other than the ones marked 'serial'. The 325 # serial tests are arranged in a chain; the last target in the 326 # serial chain depends on 'parallel' and 'all' depends on the head 327 # of the chain. Running 'make -j <whatever>' on this Makefile 328 # results in 'make' doing all of the hard work: 319 329 # 320 330 # - Load balancing just works. Most systems have a great load balancer in … … 341 351 # Even if two tests fail at the same time, since they're touching different 342 352 # files we won't miss any failures. 343 runIndices = [] 353 serialPlans = {} 354 $serialRunlist.each { |p| serialPlans[p] = nil } 355 runPlans = [] 356 serialRunPlans = [] 344 357 $runlist.each { 345 358 | plan | 346 359 if !$remote or plan.index % $remoteHosts.length == remoteIndex 347 runIndices << plan.index 360 if serialPlans.has_key?(plan) 361 serialRunPlans << plan 362 else 363 runPlans << plan 364 end 348 365 end 349 366 } 350 367 351 368 File.open($runnerDir + "Makefile.#{remoteIndex}", "w") { 352 369 | outp | 353 outp.puts("all: " + runIndices.map{|v| "test_done_#{v}"}.join(' ')) 354 runIndices.each { 355 | index | 356 plan = $runlist[index] 357 outp.puts "test_done_#{index}:" 358 outp.puts "\tsh test_script_#{plan.index}" 370 if serialRunPlans.empty? 371 outp.puts("all: parallel") 372 else 373 serialPrereq = "test_done_#{serialRunPlans[-1].index}" 374 outp.puts("all: #{serialPrereq}") 375 prev_target = "parallel" 376 serialRunPlans.each { 377 | plan | 378 prev_target = output_target(outp, plan, [prev_target]) 379 } 380 end 381 parallelTargets = runPlans.collect { 382 | plan | 383 output_target(outp, plan, []) 359 384 } 385 outp.puts("parallel: " + parallelTargets.join(" ")) 360 386 } 361 387 end
Note:
See TracChangeset
for help on using the changeset viewer.