Skip to content

Commit a2a5b67

Browse files
authored
Merge pull request kubernetes#125822 from kerthcet/fix/schedule_perf-failure
Log the error margin to avoid failures in schedule_perf
2 parents d729af9 + e106b3a commit a2a5b67

File tree

1 file changed

+3
-4
lines changed
  • test/integration/scheduler_perf

1 file changed

+3
-4
lines changed

test/integration/scheduler_perf/util.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -429,22 +429,21 @@ func (tc *throughputCollector) run(tCtx ktesting.TContext) {
429429
// be scheduled immediately when the timer
430430
// triggers. Instead we track the actual time stamps.
431431
duration := now.Sub(lastSampleTime)
432-
durationInSeconds := duration.Seconds()
433-
throughput := float64(newScheduled) / durationInSeconds
434432
expectedDuration := throughputSampleInterval * time.Duration(skipped+1)
435433
errorMargin := (duration - expectedDuration).Seconds() / expectedDuration.Seconds() * 100
436434
if tc.errorMargin > 0 && math.Abs(errorMargin) > tc.errorMargin {
437435
// This might affect the result, report it.
438-
tCtx.Errorf("ERROR: Expected throuput collector to sample at regular time intervals. The %d most recent intervals took %s instead of %s, a difference of %0.1f%%.", skipped+1, duration, expectedDuration, errorMargin)
436+
klog.Infof("WARNING: Expected throughput collector to sample at regular time intervals. The %d most recent intervals took %s instead of %s, a difference of %0.1f%%.", skipped+1, duration, expectedDuration, errorMargin)
439437
}
440438

441439
// To keep percentiles accurate, we have to record multiple samples with the same
442440
// throughput value if we skipped some intervals.
441+
throughput := float64(newScheduled) / duration.Seconds()
443442
for i := 0; i <= skipped; i++ {
444443
tc.schedulingThroughputs = append(tc.schedulingThroughputs, throughput)
445444
}
446445
lastScheduledCount = scheduled
447-
klog.Infof("%d pods scheduled", lastScheduledCount)
446+
klog.Infof("%d pods have been scheduled successfully", lastScheduledCount)
448447
skipped = 0
449448
lastSampleTime = now
450449
}

0 commit comments

Comments
 (0)