class_docstr: Run workflow to ensure no crashes, correctness/performance not tested.
class_docstr_tok: ["Run","workflow","to","ensure","no","crashes",",","correctness\/performance","not","tested","."]
code: def _test_dqn_workflow(self, use_gpu=False, use_all_avail_gpus=False):
      runner = CliRunner()
      config = get_test_workflow_config(
          path_to_config=DQN_WORKFLOW_YAML, use_gpu=use_gpu
      )
  
      # create new altered config (for faster testing)
      with runner.isolated_filesystem():
          yaml = YAML(typ="safe")
          with open(NEW_CONFIG_NAME, "w") as f:
              yaml.dump(config, f)
  
          # unzip zipped parquet folder into cwd
          with zipfile.ZipFile(
              DQN_WORKFLOW_PARQUET_ZIP, "r"
          ) as zip_ref:
              zip_ref.extractall()
  
          # patch the two calls to spark
          # dataset points to the unzipped parquet folder
          # normalization points to mocked norm extracted from json
          mock_dataset = Dataset(
              parquet_url=f"file://{os.path.abspath(DQN_WORKFLOW_PARQUET_REL_PATH)}"
          )
          mock_normalization = mock_cartpole_normalization()
          with patch(
              "reagent.data.oss_data_fetcher.OssDataFetcher.query_data",
              return_value=mock_dataset,
          ), patch(
              f"{DISCRETE_DQN_BASE}.identify_normalization_parameters",
              return_value=mock_normalization,
          ):
              # call the cli test
              result = runner.invoke(
                  cli.run,
                  [
                      "reagent.workflow.training.identify_and_train_network",
                      NEW_CONFIG_NAME,
                  ],
                  catch_exceptions=False,
              )
  
          print(result.output)
          assert result.exit_code == 0, f"result = {result}"
  
imports: import json
  import os
  import unittest
  import zipfile
  from typing import Dict
  from unittest.mock import patch
  import reagent
  import reagent.workflow.cli
  import torch
  from click.testing import CliRunner
  from reagent.core.parameters import NormalizationParameters
  from reagent.test.base.horizon_test_base import HorizonTestBase
  from reagent.workflow.types import Dataset
  from ruamel.yaml import YAML
label_desc: Use image node_id 1 for calling the TestOSSWorkflows obj's underlying member method code with example usage: obj._test_dqn_workflow(use_gpu, use_all_avail_gpus) without return types