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.
)
        result_data = result["Payload"].read()
        assert 202 == result["StatusCode"]
        assert "" == to_str(result_data).strip()
    @parametrize_java_runtimes
    def test_stream_handler(self, lambda_client, create_lambda_function, test_java_jar, runtime):
        function_name = f"test-lambda-{short_uid()}"
        create_lambda_function(
            func_name=function_name,
            zip_file=test_java_jar,
            runtime=runtime,
            handler="cloud.localstack.awssdkv1.sample.LambdaStreamHandler",
        )
        result = lambda_client.invoke(
            FunctionName=function_name,
            Payload=b'{"echo":"echo"}',
        )
        result_data = result["Payload"].read()
        assert 200 == result["StatusCode"]
        assert "{}" == to_str(result_data).strip()
    @parametrize_java_runtimes
    @pytest.mark.skip_snapshot_verify
    def test_serializable_input_object(
        self, lambda_client, create_lambda_function, test_java_zip, runtime, snapshot
    ):
        snapshot.add_transformer(snapshot.transform.lambda_api())
        
        function_name = f"test-lambda-{short_uid()}"
        create_result = create_lambda_function(
            func_name=function_name,