Page MenuHomePhabricator

If RangeState tests fail, they can hang QUnit by triggering a diff of a giant string
Closed, ResolvedPublic

Description

This is because the actual and expected objects passed into deepEqual look like this:

{
  branchNodeChanged: false,
  selectionChanged: true,
  contentChanged: true,
  ...
  node: <some ve.ce.ContentBranchNode>
}

If the objects don't compare equal:

  • Both the actual and expected objects QUnit.dump.parse into 300MB strings(!)
  • Then QUnit.diff chokes on this magnificent feast.

The problem is that the ve.ce.ContentBranchNode object property tree is quite dense. We use QUnit.dump.maxDepth = 10. At that depth there are a huge number of properties, many objects with methods that are individually dumped.

Better handling of this in QUnit would be helpful, but meanwhile we can fix this particular case by changing the node property before they're compared.

Event Timeline

Change 531468 had a related patch set uploaded (by Divec; owner: Divec):
[VisualEditor/VisualEditor@master] Prevent RangeState tests from hanging QUnit via a huge diff

https://gerrit.wikimedia.org/r/531468

Change 531468 merged by jenkins-bot:
[VisualEditor/VisualEditor@master] Prevent RangeState tests from hanging QUnit via a huge diff

https://gerrit.wikimedia.org/r/531468

Change 531488 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3a7bad9c0)

https://gerrit.wikimedia.org/r/531488

Change 531488 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (3a7bad9c0)

https://gerrit.wikimedia.org/r/531488