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 base64
import json
import logging
import os
import re
import shutil
import time
from io import BytesIO
from typing import Dict, TypeVar
import pytest
from botocore.exceptions import ClientError
from botocore.response import StreamingBody
from localstack.aws.accounts import get_aws_account_id
from localstack.services.awslambda import lambda_api
from localstack.services.awslambda.lambda_api import (
    LAMBDA_DEFAULT_HANDLER,
    LAMBDA_TEST_ROLE,
    get_lambda_policy_name,
    use_docker,
)
from localstack.services.awslambda.lambda_utils import (
    LAMBDA_RUNTIME_DOTNET6,
    LAMBDA_RUNTIME_DOTNETCORE31,
    LAMBDA_RUNTIME_GOLANG,