class_docstr: Test concurrent operations
docstr: Test that concurrent writes cannot duplicate unique fields
docstr_tok: ["Test","that","concurrent","writes","can","not","duplicate","unique","fields"]
code: def test_concurrent_unique_writes(self, orion_db):
      """Test that concurrent writes cannot duplicate unique fields"""
      orion_db.ensure_index("concurrent", "unique", unique=True)
  
      assert orion_db.count("concurrent", {"unique": 1}) == 0
  
      with Pool(10) as pool:
          pool.starmap(write, (("unique", 1) for i in range(10)))
  
      assert orion_db.count("concurrent", {"unique": 1}) == 1
  
imports: import logging
  import random
  import uuid
  from multiprocessing import Pool
  import pytest
  from filelock import FileLock, SoftFileLock, Timeout
  from orion.core.io.database import DatabaseTimeout, DuplicateKeyError
  from orion.core.io.database.ephemeraldb import EphemeralCollection
  from orion.core.io.database.pickleddb import PickledDB, _create_lock, find_unpickable_doc, find_unpickable_field, local_file_systems
  from .test_database import get_db
label_desc: Use image node_id 2 for calling the TestConcurreny obj's underlying member method code with example usage: obj.test_concurrent_unique_writes(orion_db) without return types