Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Unstable test test_subnet_map_public #455

Open
arnaudsjs opened this issue Aug 11, 2021 · 0 comments
Open

Unstable test test_subnet_map_public #455

arnaudsjs opened this issue Aug 11, 2021 · 0 comments
Labels
unstable test Stability issue, occasionnal test failure to investigate

Comments

@arnaudsjs
Copy link
Contributor

arnaudsjs commented Aug 11, 2021

The test case test_subnet_map_public fails with the following error, when the changes on the map_public_ip_on_launch attribute are not applied fast enough by aws:

____________________________ test_subnet_map_public ____________________________

project = <pytest_inmanta.plugin.Project object at 0x7ff917041c88>
ec2 = ec2.ServiceResource(), resource_name_prefix = 'inmanta-unit-test'

    def test_subnet_map_public(project, ec2, resource_name_prefix: str):
        """
        Test the map_public_ip_on_launch feature of a aws::Subnet resource
        """
        project.compile(
            f"""
    import aws
    
    provider = aws::Provider(name="test", access_key=std::get_env("AWS_ACCESS_KEY_ID"), region=std::get_env("AWS_REGION"),
                             secret_key=std::get_env("AWS_SECRET_ACCESS_KEY"), availability_zone="a")
    
    vpc = aws::VPC(name="{resource_name_prefix}", provider=provider, cidr_block="10.0.0.0/23", instance_tenancy="default")
    subnet = aws::Subnet(name="{resource_name_prefix}", provider=provider, cidr_block="10.0.0.0/24", vpc=vpc,
                         map_public_ip_on_launch=true)
    """
        )
    
        project.deploy_resource("aws::VPC")
        project.deploy_resource("aws::Subnet")
        subnets = [
            x
            for x in ec2.subnets.filter(
                Filters=[{"Name": "tag:Name", "Values": [resource_name_prefix]}]
            )
        ]
        assert len(subnets) == 1
    
>       assert subnets[0].map_public_ip_on_launch
E       AssertionError: assert False
E        +  where False = ec2.Subnet(id='subnet-0195cb837ef9ae156').map_public_ip_on_launch
@arnaudsjs arnaudsjs added the unstable test Stability issue, occasionnal test failure to investigate label Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
unstable test Stability issue, occasionnal test failure to investigate
Projects
None yet
Development

No branches or pull requests

1 participant