IllegalStateException: Test outputs data file <output.bin' does not exist but the index file '<path/output.bin.idx'> does when multiple instances of gradle (using same project path)

I am trying to run Gradle via a batch job system (Univa Grid Engine). Hundreds of machines runs jobs, all machines same project area (NFS)

Each job accepts list of tests via a file argument. gradle reads this and runs the test via include.

   ... uniq location for binary result in configure phase--
  def hostname = InetAddress.getLocalHost().getCanonicalHostName()
  def pid = ProcessHandle.current().pid()
  def hostuniq = "${hostname}-${pid}"

  binaryResultsDirectory = file(binaryResultsDirectory.asFile.get().getAbsolutePath() + "/" + { hostuniq })
  logger.info("binaryResultsDirectory=${binaryResultsDirectory}")

   ...doFirst() ---
   if (!(testlistFile = new File(testlistPath)).exists()) {
      throw new GradleException("File not present at ${testlistPath}")
    }

    testlistFile.readLines().each { line ->
      if (line.contains("#")) {
        return //ignore #lines was we write build info into the file
      }
      logger.debug "including test, line = ${line}"
      filter {
        includeTestsMatching line
      }
    }

Job works fine when run alone. When there are hundreds of jobs land on the many machines and runs the same build.gradle, some of them fails with error similar to below

Caused by: java.lang.IllegalStateException: Test outputs data file ‘/ies/iesd_data10_nb/qualitygates/iesd-20.1/CARCH-20.1-GRADLE_jnambood_test_tasks_targets/code/iesd/cbridges_src/tests/build/test-results/runTestlistFromFile/binary/test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@6c221370/output.bin’ does not exist but the index file ‘/ies/iesd_data10_nb/qualitygates/iesd-20.1/CARCH-20.1-GRADLE_jnambood_test_tasks_targets/code/iesd/cbridges_src/tests/build/test-results/runTestlistFromFile/binary/test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@6c221370/output.bin.idx’ does

My gradle command line has uniq directory for gradle user home and project cache directory.

–no-parallel --stacktrace -i --no-daemon --no-build-cache --project-cache-dir -b

Looks like there is still some race conditions/shared state that causes above error. How can I fix it?

Additional information
/build/test-results/runTestlistFromFile/binary/ has many directories. (probably one for each invocation)

They all start with same name.
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@effade3
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@f41ee83
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@f4a263d
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@f6100a7
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@f6e7736
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@f7aa5a5
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@fdf0dc0
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@fe2bab4
test_tasks_include_k6wkw50iuk71hlw8trux6pye$_run_closure3$_closure8@fed167a

binaryResultsDirectory = file(binaryResultsDirectory.asFile.get().getAbsolutePath() + “/” + { hostuniq })

definitely wrong. Providing a unique path here was needed. Works fine.