aosabook/500lines · error · Exception

Could not dispatch the test: %s

Error message

Could not dispatch the test: %s

What it means

Error "Could not dispatch the test: %s" thrown in aosabook/500lines.

Source

Thrown at ci/code/repo_observer.py:59

            # great, we have a change! let's execute the tests
            # First, check the status of the dispatcher server to see
            # if we can send the tests
            try:
                response = helpers.communicate(dispatcher_host,
                                               int(dispatcher_port),
                                               "status")
            except socket.error as e:
                raise Exception("Could not communicate with dispatcher server: %s" % e)
            if response == "OK":
                # Dispatcher is present, let's send it a test
                commit = ""
                with open(".commit_id", "r") as f:
                    commit = f.readline()
                response = helpers.communicate(dispatcher_host,
                                               int(dispatcher_port),
                                               "dispatch:%s" % commit)
                if response != "OK":
                    raise Exception("Could not dispatch the test: %s" %
                    response)
                print "dispatched!"
            else:
                # Something wrong happened to the dispatcher
                raise Exception("Could not dispatch the test: %s" %
                response)
        time.sleep(5)


if __name__ == "__main__":
    poll()

View on GitHub (pinned to fba689d101)

Solutions

  1. Make sure the commit id sent is a valid, non-empty commit hash.
  2. Check the dispatcher server logs to see why it rejected the dispatch request (e.g. no idle test runners).
  3. Start at least one test_runner connected to the dispatcher so it can accept jobs.

Example fix

python test_runner.py --dispatcher-server localhost:8888 &  # register a runner so the dispatcher returns OK to dispatch:<commit>

When it happens

Trigger: Thrown at ci/code/repo_observer.py:59 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of aosabook/500lines@fba689d101 (2026-08-13). Data as JSON: /api/errors/ab2baf644c0b1dfa. Report an issue: GitHub.