class_docstr: Tests for StreamOutputBackpressurePolicy.
class_docstr_tok: ["Tests","for","StreamOutputBackpressurePolicy","."]
code: def setUpClass(cls):
      cls._cluster_cpus = 5
      cls._cluster_object_memory = 500 * 1024 * 1024
      ray.init(
          num_cpus=cls._cluster_cpus,
          object_store_memory=cls._cluster_object_memory,
      )
      data_context = ray.data.DataContext.get_current()
      cls._num_blocks = 5
      cls._block_size = 100 * 1024 * 1024
      policy_cls = StreamingOutputBackpressurePolicy
      cls._max_blocks_in_op_output_queue = 1
      cls._max_blocks_in_generator_buffer = 1
      cls._configs = {
          ENABLED_BACKPRESSURE_POLICIES_CONFIG_KEY: [policy_cls],
          policy_cls.MAX_BLOCKS_IN_OP_OUTPUT_QUEUE_CONFIG_KEY: (
              cls._max_blocks_in_op_output_queue
          ),
          policy_cls.MAX_BLOCKS_IN_GENERATOR_BUFFER_CONFIG_KEY: (
              cls._max_blocks_in_generator_buffer
          ),
      }
      for k, v in cls._configs.items():
          data_context.set_config(k, v)
      data_context.execution_options.preserve_order = True
  
imports: import functools
  import time
  import unittest
  from collections import defaultdict
  from contextlib import contextmanager
  from unittest.mock import MagicMock, patch
  import numpy
  import pytest
  import ray
  from ray.data._internal.execution.backpressure_policy import ENABLED_BACKPRESSURE_POLICIES_CONFIG_KEY, ConcurrencyCapBackpressurePolicy, StreamingOutputBackpressurePolicy
  from ray.data.tests.conftest import restore_data_context
  from ray.data.tests.conftest import CoreExecutionMetrics, assert_core_execution_metrics_equals, get_initial_core_execution_metrics_snapshot
  from ray.tests.conftest import shutdown_only
label_desc: Use image node_id 1 for calling the TestStreamOutputBackpressurePolicy obj's underlying member method code with example usage: obj.setUpClass(cls) without return types