cockroachdb/cockroach · error

unknown roachtest of name %s

Error message

unknown roachtest of name %s

What it means

testowner maps roachtest names to owning teams: it registers every test via tests.RegisterTests into a nameToOwner map, then looks up each line read from stdin. An unknown name panics with 'unknown roachtest of name %s' — the input references a test that is not registered in this build of the registry.

Source

Thrown at pkg/cmd/testowner/testowner.go:95

	defer func() {
		_ = stdout.Flush()
	}()
	defer func() {
		_ = stderr.Flush()
	}()

	if *roachtest {
		reg := registryImpl{
			nameToOwner: make(map[string]registry.Owner),
		}
		tests.RegisterTests(&reg)
		if len(flag.Args()) == 0 {
			stdin := bufio.NewScanner(os.Stdin)
			for stdin.Scan() {
				line := stdin.Text()
				owner, ok := reg.nameToOwner[line]
				if !ok {
					panic(fmt.Sprintf("unknown roachtest of name %s", line))
				}
				_, err := stdout.WriteString(string(owner.ToTeamAlias()))
				if err != nil {
					panic(err)
				}
				err = stdout.WriteByte('\n')
				if err != nil {
					panic(err)
				}
			}
			if err := stdin.Err(); err != nil {
				panic(err)
			}

		} else if len(flag.Args()) == 1 {
			owner, ok := reg.nameToOwner[flag.Args()[0]]
			if !ok {
				panic(fmt.Sprintf("unknown roachtest of name %s", flag.Args()[0]))

View on GitHub (pinned to 8812064a01)

Solutions

  1. Get the canonical list from the registry (e.g. roachtest --list style output) and diff it against your input names
  2. Fix the upstream generator (CI script/ownership file) emitting the stale name
  3. If the test should exist, check whether registration is behind a build tag, suite guard, or skip that excluded it in this build

Example fix

# before
echo 'som_test_nma_typo' | ./testowner -roachtest

# after (validate names against the registry first)
./roachtest list --quiet > registered.txt
grep -Fxq 'some_test_name' registered.txt || { echo 'not a registered test' >&2; exit 1; }
echo 'some_test_name' | ./testowner -roachtest
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Piping a name that is misspelled, was renamed, includes a variant suffix that is not itself a test, or is conditionally registered (gated behind build tags or suite filters that skipped registration in this build).

Common situations: CI scripts holding stale roachtest names after a rename; ownership files generated from an older test list; names copied from test output that include variant decoration; tests skipped on the build platform.

Related errors


AI-assisted analysis of cockroachdb/cockroach@8812064a01 (2026-08-15). Data as JSON: /api/errors/e082d880260ab66b. Report an issue: GitHub.