Skip to content

carbon a11y tests fetch the ACE engine and rule archive at eval time (~4.5% flake) #8

Description

@john-b-yang

accessibility-checker reaches the network during evaluation, which makes carbon's
a11y-bearing tests non-deterministic. Measured rate on a full 133-instance run: 6 flaked
(127/133 first pass), all recovered by one automatic retry.

Failure signature:

TypeError: ace.Checker is not a constructor      (ACEngineManager.ts)
TypeError: ace_ibma.Checker is not a constructor

What is fetched

Two separate things, both at eval time:

  1. the engine — lib/engine/ace-node.js
  2. the rule archive itself

.achecker.yml (ruleArchive: 07Oct2020, set in constants.py) pins which archive is
used, so results are reproducible, but it does not make either fetch local.

Investigated: vendoring the engine

Works, but is only half the fix. Verified in a container:

  • copy ace-node.js into node_modules/accessibility-checker/lib/engine/
  • patch aChecker.loadLocalEngine to use it when present — necessary, because the function
    otherwise calls request.get(rulePack + "/ace-node.js") unconditionally and overwrites
    whatever is there. Its only short-circuit is an in-memory ace variable.

With able.ibm.com blackholed (v4 and v6) the engine loaded fine — 0 ACE errors — but
the a11y suites then emitted 419 ECONNREFUSED fetching the rule archive, failing 10
component suites (Button, Link, Accordion, Checkbox, Tag, Loading, ...).

What a complete fix needs

  • mirror /archives/2020.10.07/ into the image
  • point rulePack at a local server (ACConfigLoader supports a custom rule server)

That means rebuilding + re-pushing 133 images and running a static server inside every
carbon evaluation. Judged not worth it for a 4.5% transient that one retry clears.

Gotcha for anyone who picks this up

The archive id does not map to a URL of the same name. 07Oct2020 resolves via
https://able.ibm.com/rules/archives.json to path /archives/2020.10.07.
https://able.ibm.com/rules/archives/07Oct2020/js/ace-node.js returns 404;
https://able.ibm.com/rules/archives/2020.10.07/js/ace-node.js returns 200 (404 KB).
Building an image from the guessed URL would silently bake a 404 page into 133 images.

Current mitigation

Retry once on failure (carbon rebuild pipeline does this: 127/133 → 133/133), plus
--maxWorkers=4 for carbon, which appears to reduce the rate further — two instances that
failed uncapped passed with the cap.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions