Merge pull request #98793 from wzshiming/ut/speed-up-endpointslice

Speed up pkg/controller/endpointslice unit tests
This commit is contained in:
Kubernetes Prow Robot 2021-02-05 17:51:11 -08:00 committed by GitHub
commit c15851b777
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1046,6 +1046,8 @@ func TestSyncService(t *testing.T) {
// This test uses real time.Sleep, as there is no easy way to mock time in endpoints controller now.
// TODO(mborsz): Migrate this test to mock clock when possible.
func TestPodAddsBatching(t *testing.T) {
t.Parallel()
type podAdd struct {
delay time.Duration
}
@ -1153,6 +1155,8 @@ func TestPodAddsBatching(t *testing.T) {
// This test uses real time.Sleep, as there is no easy way to mock time in endpoints controller now.
// TODO(mborsz): Migrate this test to mock clock when possible.
func TestPodUpdatesBatching(t *testing.T) {
t.Parallel()
resourceVersion := 1
type podUpdate struct {
delay time.Duration
@ -1299,6 +1303,8 @@ func TestPodUpdatesBatching(t *testing.T) {
// This test uses real time.Sleep, as there is no easy way to mock time in endpoints controller now.
// TODO(mborsz): Migrate this test to mock clock when possible.
func TestPodDeleteBatching(t *testing.T) {
t.Parallel()
type podDelete struct {
delay time.Duration
podName string