Skip to content

Commit 63914f2

Browse files
authored
fix eip test (#1592)
1 parent 9547c42 commit 63914f2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tencentcloud/resource_tc_eip_association_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ func TestAccTencentCloudEipAssociationWithInstance(t *testing.T) {
1818
CheckDestroy: testAccCheckEipAssociationDestroy,
1919
Steps: []resource.TestStep{
2020
{
21-
Config: testAccTencentCloudEipAssociationWithInstance,
21+
PreConfig: func() { testAccStepPreConfigSetTempAKSK(t, ACCOUNT_TYPE_COMMON) },
22+
Config: testAccTencentCloudEipAssociationWithInstance,
2223
Check: resource.ComposeTestCheckFunc(
2324
testAccCheckEipAssociationExists(id),
2425
resource.TestCheckResourceAttrSet(id, "eip_id"),
@@ -48,7 +49,8 @@ func TestAccTencentCloudEipAssociationWithNetworkInterface(t *testing.T) {
4849
CheckDestroy: testAccCheckEipAssociationDestroy,
4950
Steps: []resource.TestStep{
5051
{
51-
Config: testAccTencentCloudEipAssociationWithNetworkInterface,
52+
PreConfig: func() { testAccStepPreConfigSetTempAKSK(t, ACCOUNT_TYPE_COMMON) },
53+
Config: testAccTencentCloudEipAssociationWithNetworkInterface,
5254
Check: resource.ComposeTestCheckFunc(
5355
testAccCheckEipAssociationExists(id),
5456
resource.TestCheckResourceAttrSet(id, "eip_id"),

tencentcloud/resource_tc_eip_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,9 @@ func TestAccTencentCloudEipResource_prepaid(t *testing.T) {
225225
),
226226
},
227227
{
228+
PreConfig: func() { //sleep 1 min after update
229+
time.Sleep(10 * time.Second)
230+
},
228231
ResourceName: "tencentcloud_eip.foo",
229232
ImportState: true,
230233
ImportStateVerify: true,

0 commit comments

Comments
 (0)