getConfigDirectoryName = (testTitle, configNumber) => {
  const defaultPath = testTitle.replace(/\s/giu, '-').replace(/[^\w-]/giu, '');

  // We truncate the subdirectory name to 30 characters in an attempt to respect
  // the maximum Unix domain socket path length.
  // With our apologies to John Jacob Jingleheimerschmidt, for whom this may
  // not be enough.
  const basePath =
    defaultPath.length <= 22 ? defaultPath : defaultPath.slice(0, 22);
  const testId = String(configPathId).padStart(4, '0');
  const configId = String(configNumber).padStart(2, '0');
  const configSubDirectory = `${basePath}#${testId}-${configId}`;

  configPathId += 1;

  return configSubDirectory;
}
@param {string} testTitle - The title of the current test.
@param {number} configNumber - The number of the current config. If this
is the n:th config created for the current test, the config number is n.