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.
assert payload["errorType"] == "CustomException"
        assert payload["errorMessage"] == "some error occurred"
        assert "stackTrace" in payload
        if (
            runtime == "python3.9" and not is_old_provider()
        ):  
            assert "requestId" in payload
        else:
            assert "requestId" not in payload
parametrize_node_runtimes = pytest.mark.parametrize(
    "runtime",
    NODE_TEST_RUNTIMES,
)
class TestNodeJSRuntimes:
    @pytest.mark.skipif(
        not use_docker(), reason="Test for docker nodejs runtimes not applicable if run locally"
    )
    @parametrize_node_runtimes
    @pytest.mark.skip_snapshot_verify
    def test_nodejs_lambda_with_context(
        self, lambda_client, create_lambda_function, runtime, check_lambda_logs, snapshot
    ):
        """Test context of nodejs lambda invocation"""
        snapshot.add_transformer(snapshot.transform.lambda_api())
        function_name = f"test-function-{short_uid()}"
        creation_response = create_lambda_function(
            func_name=function_name,
            handler_file=TEST_LAMBDA_INTEGRATION_NODEJS,
            handler="lambda_integration.handler",
            runtime=runtime,