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

r/spot_instances_request: Fix failing acceptance test (SubnetId) #2054

Merged
merged 1 commit into from
Oct 27, 2017

Conversation

radeksimko
Copy link
Member

This is to address the following test failure:

=== RUN   TestAccAWSSpotInstanceRequest_vpc
--- FAIL: TestAccAWSSpotInstanceRequest_vpc (213.48s)
    testing.go:435: Step 0 error: Check failed: Check 4/6 error: SubnetID was not passed, but should have been for this instance to belong to a VPC

Background

The test started failing since 9th August and there were no code changes involved in that test or resource in the first failure https://github.com/terraform-providers/terraform-provider-aws/blob/37cf4e6f4086285603c0a447de7d3b62bc3e9348/aws/resource_aws_spot_instance_request_test.go#L443

However on closer inspection it looks like AWS modified the API response. Here's one from 8th August:

2017/08/08 07:35:35 [DEBUG] [aws-sdk-go] <?xml version="1.0" encoding="UTF-8"?>
<DescribeSpotInstanceRequestsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>7fc4cb62-c0f7-47e9-a232-ebbdb6be9381</requestId>
    <spotInstanceRequestSet>
        <item>
            <spotInstanceRequestId>sir-g1siaa9q</spotInstanceRequestId>
            <spotPrice>0.050000</spotPrice>
            <type>persistent</type>
            <state>active</state>
            <status>
                <code>fulfilled</code>
                <updateTime>2017-08-08T07:35:30.000Z</updateTime>
                <message>Your Spot request is fulfilled.</message>
            </status>
            <launchSpecification>
                <imageId>ami-4fccb37f</imageId>
                <keyName>tmp-key-3107743772220979371</keyName>
                <groupSet>
                    <item>
                        <groupId>sg-620d6418</groupId>
                        <groupName>default</groupName>
                    </item>
                </groupSet>
                <instanceType>m1.small</instanceType>
                <placement>
                    <availabilityZone>us-west-2c</availabilityZone>
                    <groupName/>
                </placement>
                <monitoring>
                    <enabled>false</enabled>
                </monitoring>
                <subnetId>subnet-4c920717</subnetId>
                <iamInstanceProfile>
                    <name/>
                </iamInstanceProfile>
                <ebsOptimized>false</ebsOptimized>
            </launchSpecification>
            <instanceId>i-0dc1542a6f9ab9485</instanceId>
            <createTime>2017-08-08T07:35:24.000Z</createTime>
            <productDescription>Linux/UNIX</productDescription>
            <tagSet>
                <item>
                    <key>Name</key>
                    <value>terraform-test-VPC</value>
                </item>
            </tagSet>
            <launchedAvailabilityZone>us-west-2c</launchedAvailabilityZone>
        </item>
    </spotInstanceRequestSet>
</DescribeSpotInstanceRequestsResponse>

and here's one from today:

<DescribeSpotInstanceRequestsResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
    <requestId>e261b1dd-11dc-41f5-ad95-7325ca07b9c8</requestId>
    <spotInstanceRequestSet>
        <item>
            <spotInstanceRequestId>sir-97vrasdm</spotInstanceRequestId>
            <spotPrice>0.050000</spotPrice>
            <type>persistent</type>
            <state>active</state>
            <status>
                <code>fulfilled</code>
                <updateTime>2017-10-25T14:19:37.000Z</updateTime>
                <message>Your Spot request is fulfilled.</message>
            </status>
            <launchSpecification>
                <imageId>ami-4fccb37f</imageId>
                <keyName>tmp-key-1789522026768986395</keyName>
                <groupSet>
                    <item>
                        <groupName>default</groupName>
                    </item>
                </groupSet>
                <instanceType>m1.small</instanceType>
                <placement>
                    <availabilityZone>us-west-2a</availabilityZone>
                    <groupName/>
                </placement>
                <monitoring>
                    <enabled>false</enabled>
                </monitoring>
                <networkInterfaceSet>
                    <item>
                        <deviceIndex>0</deviceIndex>
                        <subnetId>subnet-c558d78d</subnetId>
                        <groupSet>
                            <item>
                                <groupId>sg-409fe63d</groupId>
                            </item>
                        </groupSet>
                    </item>
                </networkInterfaceSet>
                <iamInstanceProfile>
                    <name/>
                </iamInstanceProfile>
                <ebsOptimized>false</ebsOptimized>
            </launchSpecification>
            <instanceId>i-007472e1e4096fbc9</instanceId>
            <createTime>2017-10-25T14:19:30.000Z</createTime>
            <productDescription>Linux/UNIX</productDescription>
            <launchedAvailabilityZone>us-west-2a</launchedAvailabilityZone>
            <instanceInterruptionBehavior>terminate</instanceInterruptionBehavior>
        </item>
    </spotInstanceRequestSet>
</DescribeSpotInstanceRequestsResponse>

Test results

screen shot 2017-10-25 at 15 54 30

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Oct 25, 2017
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@radeksimko radeksimko merged commit 1bf1537 into master Oct 27, 2017
@radeksimko radeksimko deleted the b-spot-instance-subnet-id branch October 27, 2017 14:41
@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants