Set end of subslice as begin of next subslice

syscall test split testcase via shard count, reset
high bound as begin of next subslice, cause the slice
is half-open range.

Change-Id: I1954f57c93cbfd9be518153315da305a2de377a0
PiperOrigin-RevId: 229405199
This commit is contained in:
Yong He 2019-01-15 11:14:59 -08:00 committed by Shentubot
parent dc8450b567
commit 6c117a01e9
1 changed files with 2 additions and 1 deletions

View File

@ -271,7 +271,8 @@ func main() {
// Calculate subslice of tests to run.
shardSize := int(math.Ceil(float64(len(testCases)) / float64(total)))
begin := index * shardSize
end := ((index + 1) * shardSize) - 1
// Set end as begin of next subslice.
end := ((index + 1) * shardSize)
if begin > len(testCases) {
// Nothing to run.
return