Skip to content

Commit 901ec1a

Browse files
tongyimingmikatong
andauthored
fix: TestAccTencentCloudInstanceWithPassword && TestAccTencentCloudInstanceWithImageLogin (#1058)
Co-authored-by: mikatong <mikatong@tencent.com>
1 parent f9e7f38 commit 901ec1a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tencentcloud/resource_tc_instance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ func resourceTencentCloudInstanceUpdate(d *schema.ResourceData, meta interface{}
12361236
ov := o.([]interface{})
12371237
nv := n.([]interface{})
12381238

1239-
if len(nv) != len(nv) {
1239+
if len(ov) != len(nv) {
12401240
return fmt.Errorf("error: data disk count has changed (%d -> %d) but doesn't support add or remove for now", len(ov), len(nv))
12411241
}
12421242

tencentcloud/resource_tc_instance_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func TestAccTencentCloudInstanceWithPrivateIP(t *testing.T) {
206206
})
207207
}
208208

209-
func TestAccTencentCloudInstanceWithKeyPair(t *testing.T) {
209+
func TestAccTencentCloudNeedFixInstanceWithKeyPair(t *testing.T) {
210210
t.Parallel()
211211

212212
id := "tencentcloud_instance.foo"
@@ -261,8 +261,11 @@ func TestAccTencentCloudInstanceWithPassword(t *testing.T) {
261261
),
262262
},
263263
{
264-
PreConfig: func() { testAccStepPreConfigSetTempAKSK(t, ACCOUNT_TYPE_COMMON) },
265-
Config: testAccTencentCloudInstanceWithPassword("TF_test_123456"),
264+
PreConfig: func() {
265+
testAccStepPreConfigSetTempAKSK(t, ACCOUNT_TYPE_COMMON)
266+
time.Sleep(time.Duration(time.Second * 5))
267+
},
268+
Config: testAccTencentCloudInstanceWithPassword("TF_test_123456"),
266269
Check: resource.ComposeTestCheckFunc(
267270
testAccCheckTencentCloudDataSourceID(id),
268271
testAccCheckTencentCloudInstanceExists(id),

0 commit comments

Comments
 (0)