Class: Google::Apis::TestingV1::SmartSharding
- Inherits:
-
Object
- Object
- Google::Apis::TestingV1::SmartSharding
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/testing_v1/classes.rb,
lib/google/apis/testing_v1/representations.rb,
lib/google/apis/testing_v1/representations.rb
Overview
Shards test based on previous test case timing records.
Instance Attribute Summary collapse
-
#targeted_shard_duration ⇒ String
The amount of time tests within a shard should take.
Instance Method Summary collapse
-
#initialize(**args) ⇒ SmartSharding
constructor
A new instance of SmartSharding.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ SmartSharding
Returns a new instance of SmartSharding.
2151 2152 2153 |
# File 'lib/google/apis/testing_v1/classes.rb', line 2151 def initialize(**args) update!(**args) end |
Instance Attribute Details
#targeted_shard_duration ⇒ String
The amount of time tests within a shard should take. Default: 300 seconds (5
minutes). The minimum allowed: 120 seconds (2 minutes). The shard count is
dynamically set based on time, up to the maximum shard limit (described below).
To guarantee at least one test case for each shard, the number of shards will
not exceed the number of test cases. Shard duration will be exceeded if: - The
maximum shard limit is reached and there is more calculated test time
remaining to allocate into shards. - Any individual test is estimated to be
longer than the targeted shard duration. Shard duration is not guaranteed
because smart sharding uses test case history and default durations which may
not be accurate. The rules for finding the test case timing records are: - If
the service has seen a test case in the last 30 days, the record of the latest
successful one will be used. - For new test cases, the average duration of
other known test cases will be used. - If there are no previous test case
timing records available, the test case is considered to be 15 seconds long by
default. Because the actual shard duration can exceed the targeted shard
duration, we recommend setting the targeted value at least 5 minutes less than
the maximum allowed test timeout (45 minutes for physical devices and 60
minutes for virtual), or using the custom test timeout value you set. This
approach avoids cancelling the shard before all tests can finish. Note that
there is a limit for maximum number of shards. When you select one or more
physical devices, the number of shards must be <= 50. When you select one or
more ARM virtual devices, it must be <= 100. When you select only x86 virtual
devices, it must be <= 500. To guarantee at least one test case for per shard,
the number of shards will not exceed the number of test cases. Each shard
created will count toward daily test quota.
Corresponds to the JSON property targetedShardDuration
2149 2150 2151 |
# File 'lib/google/apis/testing_v1/classes.rb', line 2149 def targeted_shard_duration @targeted_shard_duration end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2156 2157 2158 |
# File 'lib/google/apis/testing_v1/classes.rb', line 2156 def update!(**args) @targeted_shard_duration = args[:targeted_shard_duration] if args.key?(:targeted_shard_duration) end |