Skip to content

Commit

Permalink
run ut parallelly to make it fast
Browse files Browse the repository at this point in the history
  • Loading branch information
waynepeking348 committed Jul 11, 2023
1 parent 2e07b5b commit 1d392d2
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# options for analysis running
run:
# default concurrency is a available CPU number
concurrency: 4
concurrency: 16

# timeout for analysis, e.g. 30s, 5m, default is 1m
timeout: 10m
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ vet: ## Run go vet against code.

.PHONY: test
test: ## Run go test against code.
go test -v -coverprofile=coverage.txt -covermode=atomic -race -coverpkg=./... ./...
go test -v -coverprofile=coverage.txt -parallel 16 -p 16 -covermode=atomic -race -coverpkg=./... ./...

.PHONY: license
license:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
)

func TestMemoryPressureEvictionPluginOptions_ApplyTo(t *testing.T) {
t.Parallel()

options := NewMemoryPressureEvictionOptions()
configuration := eviction.NewMemoryPressureEvictionPluginConfiguration()

Expand Down
2 changes: 2 additions & 0 deletions pkg/util/native/pods_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
)

func TestFilterPodAnnotations(t *testing.T) {
t.Parallel()

for _, tc := range []struct {
name string
pod *v1.Pod
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/native/qos_resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ var makeQoSResourcePod = func(name string, container, initContainer, overhead v1
}

func Test_CalculateQoSResource(t *testing.T) {
t.Parallel()

for _, tc := range []struct {
name string
pod *v1.Pod
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/native/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ var makePod = func(name string, request, limits v1.ResourceList) *v1.Pod {
}

func TestNeedUpdateResources(t *testing.T) {
t.Parallel()

for _, tc := range []struct {
name string
pod *v1.Pod
Expand Down
2 changes: 2 additions & 0 deletions pkg/util/process/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func (d dummyResponseWriter) Write([]byte) (int, error) { return 0, nil }
func (d dummyResponseWriter) WriteHeader(_ int) {}

func TestHTTPHandler(t *testing.T) {
t.Parallel()

httpCleanupVisitorPeriod = time.Second
httpSyncPasswdPeriod = time.Second

Expand Down
2 changes: 2 additions & 0 deletions pkg/util/qos/net_enhancement_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import (
)

func TestGetPodNetClassID(t *testing.T) {
t.Parallel()

for _, tc := range []struct {
name string
pod *v1.Pod
Expand Down
2 changes: 2 additions & 0 deletions pkg/webhook/mutating/pod/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ func getPodJSON(pod *v1.Pod) []byte {
}

func TestMutatePod(t *testing.T) {
t.Parallel()

container1 := &v1.Container{
Name: "c1",
Resources: v1.ResourceRequirements{
Expand Down

0 comments on commit 1d392d2

Please sign in to comment.