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.
):
        """Test simple nodejs lambda invocation"""
        snapshot.add_transformer(snapshot.transform.lambda_api())
        function_name = f"test-function-{short_uid()}"
        result = create_lambda_function(
            func_name=function_name,
            zip_file=testutil.create_zip_file(TEST_LAMBDA_NODEJS, get_content=True),
            runtime=runtime,
            handler="lambda_handler.handler",
        )
        snapshot.match("creation-result", result)
        rs = lambda_client.invoke(
            FunctionName=function_name,
            Payload=json.dumps({"event_type": "test_lambda"}),
        )
        assert 200 == rs["ResponseMetadata"]["HTTPStatusCode"]
        rs = read_streams(rs)
        snapshot.match("invocation-result", rs)
        payload = rs["Payload"]
        response = json.loads(payload)
        assert "response from localstack lambda" in response["body"]
        def assert_events():
            events = get_lambda_log_events(function_name, logs_client=logs_client)
            assert len(events) > 0
        retry(assert_events, retries=10)
    @pytest.mark.parametrize("runtime", (LAMBDA_RUNTIME_NODEJS14X, LAMBDA_RUNTIME_NODEJS16X))
    @pytest.mark.skip_snapshot_verify
    @pytest.mark.skipif(
        not use_docker(), reason="ES6 support is only guaranteed when using the docker executor"
    )