{"record":{"id":"237a0c6453a08eff","repo":"grosser/parallel_tests","slug":"can-t-pass-specify-groups-with-any-of-these-keys","errorCode":null,"errorMessage":"Can't pass --specify-groups with any of these keys: --single, --isolate, or --isolate-n","messagePattern":"Can't pass --specify-groups with any of these keys: --single, --isolate, or --isolate-n","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"lib/parallel_tests/cli.rb","lineNumber":380,"sourceCode":"          end\n        end\n        options[:files] = files.map { |file_path| Pathname.new(file_path).cleanpath.to_s }\n      end\n\n      append_test_options(options, remaining)\n\n      options[:group_by] ||= :filesize if options[:only_group]\n\n      if options[:group_by] == :found && options[:single_process]\n        raise \"--group-by found and --single-process are not supported\"\n      end\n      allowed = [:filesize, :runtime, :found]\n      if !allowed.include?(options[:group_by]) && options[:only_group]\n        raise \"--group-by #{allowed.join(\" or \")} is required for --only-group\"\n      end\n\n      if options[:specify_groups] && options.keys.intersect?([:single_process, :isolate, :isolate_count])\n        raise \"Can't pass --specify-groups with any of these keys: --single, --isolate, or --isolate-n\"\n      end\n\n      if options[:failure_exit_code] && options[:highest_exit_status]\n        raise \"Can't pass --failure-exit-code and --highest-exit-status\"\n      end\n\n      options\n    end\n\n    def extract_file_paths(argv)\n      dash_index = argv.rindex(\"--\")\n      file_args_at = (dash_index || -1) + 1\n      [argv[file_args_at..], argv[0...(dash_index || 0)]]\n    end\n\n    def extract_test_options(argv)\n      dash_index = argv.index(\"--\") || -1\n      argv[dash_index + 1..]","sourceCodeStart":362,"sourceCodeEnd":398,"githubUrl":"https://github.com/grosser/parallel_tests/blob/a06047856d3564ee77848e230d61cb6503037ad7/lib/parallel_tests/cli.rb#L362-L398","documentation":"--specify-groups pins exact specs to exact processes, while --single/-s, --isolate and --isolate-n also dictate which process certain tests land in. The two placement mechanisms would overwrite each other, so parse_options! rejects the combination by intersecting the options keys with [:single_process, :isolate, :isolate_count].","triggerScenarios":"`parallel_test -n 3 --specify-groups 'a_spec.rb,b_spec.rb|c_spec.rb' --isolate`, the same with `-s pattern` or `--isolate-n 2`, or a rake/CI option string containing --specify-groups together with any isolation flag.","commonSituations":"Teams migrate from --isolate/--single workflows to explicit group pinning (e.g. to debug flaky splits) and forget to strip the old flags; shared CI option lists merge flags from several jobs into one string.","solutions":["Remove --single/-s, --isolate and --isolate-n from the command","If certain specs still must be isolated, express that inside --specify-groups by putting them alone in their own pipe-separated process group"],"exampleFix":"# before\nparallel_test -n 3 --isolate --specify-groups 'a_spec.rb|b_spec.rb'\n\n# after\nparallel_test -n 3 --specify-groups 'a_spec.rb|b_spec.rb'","handlingStrategy":"validation","validationCode":"opts = ENV.fetch('PARALLEL_TEST_OPTS', '').shellsplit\nconflicting = opts.any? { |o| o == '-s' || o.start_with?('--single', '--isolate') } # --isolate-n matches the --isolate prefix\nif opts.include?('--specify-groups') && conflicting\n  abort 'parallel_tests: --specify-groups cannot be combined with --single/--isolate/--isolate-n'\nend","typeGuard":"def specify_groups_args_valid?(argv)\n  return true unless argv.any? { |a| a == '--specify-groups' || a.start_with?('--specify-groups=') }\n  argv.none? { |a| a == '-s' || a.start_with?('--single', '--isolate') }\nend","tryCatchPattern":"begin\n  ParallelTests::CLI.new.run(args)\nrescue RuntimeError => e\n  abort \"#{e.message} -- keep exactly one placement mechanism per command\"\nend","preventionTips":["Use one placement mechanism per command: manual pinning (--specify-groups) OR pattern-based isolation (--single/--isolate*)","Review and prune old flags when adopting --specify-groups","Keep CI job option strings per-job instead of sharing one global list"],"tags":["ruby","parallel-tests","cli","specify-groups","conflicting-options"],"backgroundTag":"conflicting-cli-options","analyzedSha":"a06047856d3564ee77848e230d61cb6503037ad7","analyzedAt":"2026-08-23T10:12:36.391Z","schemaVersion":2},"datasetVersion":"2026-08-23T13:39:53.451Z"}