nodejs/node · error · Exception

Invalid suite configuration.

Error message

Invalid suite configuration.

What it means

Thrown by FlattenRunnables in run_perf.py during tree traversal when a node is neither a RunnableConfig nor an instance of the tree Node base class. Marked '# pragma: no cover' because the tree builder is expected to always produce Node subclasses, so reaching this means the tree was constructed outside the normal BuildGraphConfigs path or corrupted.

Source

Thrown at deps/v8/tools/run_perf.py:741

      for subsuite in variant_suite.get('tests', []):
        BuildGraphConfigs(subsuite, variant_graph, arch)
  parent.AppendChild(graph)
  return graph


def FlattenRunnables(node, node_cb):
  """Generator that traverses the tree structure and iterates over all
  runnables.
  """
  node_cb(node)
  if isinstance(node, RunnableConfig):
    yield node
  elif isinstance(node, Node):
    for child in node._children:
      for result in FlattenRunnables(child, node_cb):
        yield result
  else:  # pragma: no cover
    raise Exception('Invalid suite configuration.')


def find_build_directory(base_path, arch):
  """Returns the location of d8 or node in the build output directory.

  This supports a seamless transition between legacy build location
  (out/Release) and new build location (out/build).
  """
  def is_build(path):
    # We support d8 or node as executables. We don't support testing on
    # Windows.
    return (os.path.isfile(os.path.join(path, 'd8')) or
            os.path.isfile(os.path.join(path, 'node')))
  possible_paths = [
    # Location developer wrapper scripts is using.
    '%s.release' % arch,
    # Current build location on bots.
    'build',

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Ensure the tree passed to FlattenRunnables is always built by BuildGraphConfigs (which only ever instantiates Node subclasses).
  2. If you construct nodes manually, verify every element in each node._children is an instance of Node before traversal.
  3. Add an assertion at the BuildGraphConfigs entry point that the root is a Node, to fail early with a clear message.

Example fix

null
Defensive patterns

Strategy: type-guard

Validate before calling

from tools.run_perf import Node
def assert_tree_is_valid(root):
    stack = [root]
    while stack:
        n = stack.pop()
        if not isinstance(n, Node):
            raise TypeError(f'Non-Node object in tree: {n!r}')
        stack.extend(getattr(n, '_children', []))

Type guard

from tools.run_perf import Node
def is_tree_of_nodes(root) -> bool:
    stack = [root]
    while stack:
        n = stack.pop()
        if not isinstance(n, Node):
            return False
        stack.extend(getattr(n, '_children', []))
    return True

Try / catch

null

Prevention

When it happens

Trigger: FlattenRunnables is called over a structure that contains a non-Node object (e.g. a raw dict, None, or a primitive) because something injected a foreign value into a node's _children list, or the traversal root itself is not a Node.

Common situations: A custom perf-harness or monkey-patch that builds the runnable tree by hand instead of via BuildGraphConfigs; or a bug in AppendChild that allowed a non-Node into _children.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/da3855e0e22b21b3. Report an issue: GitHub.