Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testcase: Improve the unit of the test cases #4544

Merged
merged 1 commit into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions alicloud/resource_alicloud_cr_chart_namespace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,10 @@ func TestAccAlicloudCRChartNamespace_unit(t *testing.T) {
})
t.Run("DeleteMockAbnormal", func(t *testing.T) {
retryFlag := true
noRetryFlag := false
noRetryFlag := true
patches := gomonkey.ApplyMethod(reflect.TypeOf(&client.Client{}), "DoRequest", func(_ *client.Client, _ *string, _ *string, _ *string, _ *string, _ *string, _ map[string]interface{}, _ map[string]interface{}, _ *util.RuntimeOptions) (map[string]interface{}, error) {
if retryFlag {
// retry until the timeout comes
retryFlag = false
return responseMock["RetryError"]("Throttling")
} else if noRetryFlag {
noRetryFlag = false
Expand Down
4 changes: 2 additions & 2 deletions alicloud/resource_alicloud_cr_chart_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,10 +349,10 @@ func TestAccAlicloudCRChartRepository_unit(t *testing.T) {
})
t.Run("DeleteMockAbnormal", func(t *testing.T) {
retryFlag := true
noRetryFlag := false
noRetryFlag := true
patches := gomonkey.ApplyMethod(reflect.TypeOf(&client.Client{}), "DoRequest", func(_ *client.Client, _ *string, _ *string, _ *string, _ *string, _ *string, _ map[string]interface{}, _ map[string]interface{}, _ *util.RuntimeOptions) (map[string]interface{}, error) {
if retryFlag {
// retry until the timeout comes
retryFlag = false
return responseMock["RetryError"]("Throttling")
} else if noRetryFlag {
noRetryFlag = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,10 @@ func TestAccAlicloudEcsAutoSnapshotPolicyAttachment_unit(t *testing.T) {
})
t.Run("DeleteMockAbnormal", func(t *testing.T) {
retryFlag := true
noRetryFlag := false
noRetryFlag := true
patches := gomonkey.ApplyMethod(reflect.TypeOf(&client.Client{}), "DoRequest", func(_ *client.Client, _ *string, _ *string, _ *string, _ *string, _ *string, _ map[string]interface{}, _ map[string]interface{}, _ *util.RuntimeOptions) (map[string]interface{}, error) {
if retryFlag {
// retry until the timeout comes
retryFlag = false
return responseMock["RetryError"]("Throttling")
} else if noRetryFlag {
noRetryFlag = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ resource "alicloud_vpc_traffic_mirror_filter" "default" {
}

func TestAccAlicloudVPCTrafficMirrorFilterEgressRule_unit(t *testing.T) {
t.Parallel()
p := Provider().(*schema.Provider).ResourcesMap
d, _ := schema.InternalMap(p["alicloud_vpc_traffic_mirror_filter_egress_rule"].Schema).Data(nil, nil)
dCreate, _ := schema.InternalMap(p["alicloud_vpc_traffic_mirror_filter_egress_rule"].Schema).Data(nil, nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ resource "alicloud_vpc_traffic_mirror_filter" "default" {
}

func TestAccAlicloudVPCTrafficMirrorFilterIngressRule_unit(t *testing.T) {
t.Parallel()
p := Provider().(*schema.Provider).ResourcesMap
d, _ := schema.InternalMap(p["alicloud_vpc_traffic_mirror_filter_ingress_rule"].Schema).Data(nil, nil)
dCreate, _ := schema.InternalMap(p["alicloud_vpc_traffic_mirror_filter_ingress_rule"].Schema).Data(nil, nil)
Expand Down