未验证 提交 9893998f 编写于 作者: E Eileen M. Uchitelle 提交者: GitHub

Merge pull request #34410 from gmcgibbon/test_support_windows

Windows support for parallelization and instrumenter
......@@ -55,6 +55,11 @@ class Event
attr_reader :name, :time, :transaction_id, :payload, :children
attr_accessor :end
def self.clock_gettime_supported? # :nodoc:
defined?(Process::CLOCK_PROCESS_CPUTIME_ID) &&
!Gem.win_platform?
end
def initialize(name, start, ending, transaction_id, payload)
@name = name
@payload = payload.dup
......@@ -130,7 +135,7 @@ def now
Process.clock_gettime(Process::CLOCK_MONOTONIC)
end
if defined?(Process::CLOCK_PROCESS_CPUTIME_ID)
if clock_gettime_supported?
def now_cpu
Process.clock_gettime(Process::CLOCK_PROCESS_CPUTIME_ID)
end
......
# frozen_string_literal: true
require "drb"
require "drb/unix"
require "drb/unix" unless Gem.win_platform?
require "active_support/core_ext/module/attribute_accessors"
module ActiveSupport
......
......@@ -4,7 +4,7 @@ require 'rails/test_help'
class ActiveSupport::TestCase
# Run tests in parallel with specified workers
<% if defined?(JRUBY_VERSION) -%>
<% if defined?(JRUBY_VERSION) || Gem.win_platform? -%>
parallelize(workers: 2, with: :threads)
<%- else -%>
parallelize(workers: 2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册