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.
data_before = b'{"foo": "bar with \'quotes\\""}'
        result = lambda_client.invoke(
            FunctionName=function_name, Payload=data_before, Qualifier=qualifier
        )
        result = read_streams(result)
        snapshot.match("invocation-response", result)
        data_after = json.loads(result["Payload"])
        assert json.loads(to_str(data_before)) == data_after["event"]
        context = data_after["context"]
        assert response["Version"] == context["function_version"]
        assert context.get("aws_request_id")
        assert function_name == context["function_name"]
        assert f"/aws/lambda/{function_name}" == context["log_group_name"]
        assert context.get("log_stream_name")
        assert context.get("memory_limit_in_mb")
        
        expected = [".*Lambda log message - print function.*"]
        if use_docker():
            
            
            expected.append(".*Lambda log message - logging module.*")
        def check_logs():
            check_lambda_logs(function_name, expected_lines=expected)
        retry(check_logs, retries=10)
        lambda_client.delete_function(FunctionName=function_name)
    @parametrize_python_runtimes
    @pytest.mark.skip_snapshot_verify
    def test_upload_lambda_from_s3(
        self,
        lambda_client,