While a lambda is still processing (archive unpacking etc), the lambda state should be set to "Pending" (currently "Active") and invocations to that lambda should fail (currently, it can end up in a inconsistent state in this case, like lambdas being executed without layers).

Lambda state should reflect the current internal state, and invocations should fail if not active.
import os
import time
import unittest
import pytest
from localstack import config
from localstack.services.awslambda import lambda_api, lambda_executors
from localstack.services.awslambda.lambda_api import use_docker
from localstack.services.awslambda.lambda_utils import LAMBDA_RUNTIME_PYTHON36
from localstack.services.generic_proxy import ProxyListener
from localstack.services.infra import start_proxy
from localstack.utils import testutil
from localstack.utils.aws import aws_stack
from localstack.utils.common import (
    get_free_tcp_port,
    get_service_protocol,
    load_file,
    retry,
    run_safe,
    short_uid,
    to_bytes,
    to_str,
)
from .test_lambda import TEST_LAMBDA_ENV, TEST_LAMBDA_LIBS, TEST_LAMBDA_PYTHON
THIS_FOLDER = os.path.dirname(os.path.realpath(__file__))
TEST_LAMBDA_PYTHON3_MULTIPLE_CREATE1 = os.path.join(
    THIS_FOLDER, "functions", "python3", "lambda1", "lambda1.zip"
)
TEST_LAMBDA_PYTHON3_MULTIPLE_CREATE2 = os.path.join(
    THIS_FOLDER, "functions", "python3", "lambda2", "lambda2.zip"
)