code: def test_sync_vector_determinism(
      spec: EnvSpec, seed: int = 123, n: int = 3
  ):
      """Check that for all environments, the sync vector envs produce the same action samples using the same seeds"""
      env_1 = SyncVectorEnv(
          [make_env(spec.id, seed=seed) for _ in range(n)]
      )
      env_2 = SyncVectorEnv(
          [make_env(spec.id, seed=seed) for _ in range(n)]
      )
      assert_rng_equal(
          env_1.action_space.np_random, env_2.action_space.np_random
      )
  
      for _ in range(100):
          env_1_samples = env_1.action_space.sample()
          env_2_samples = env_2.action_space.sample()
          assert np.all(env_1_samples == env_2_samples)
  
file_path: gym/tests/vector/test_sync_vector_env.py
imports: import numpy
  import pytest
  from gym.envs.registration import EnvSpec
  from gym.spaces import Box, Discrete, MultiDiscrete, Tuple
  from gym.vector.sync_vector_env import SyncVectorEnv
  from tests.envs.utils import all_testing_env_specs
  from tests.vector.utils import CustomSpace, assert_rng_equal, make_custom_space_env, make_env
label_desc: Use image node_id 9 for calling a global function with example usage: test_sync_vector_determinism(spec, seed, n) without return types