When running the test script, some of the node collapsed meta edges do not get destroyed for unidentified reasons. Which creates an unbalanced edge count and the test fails.
If the corresponding source node is collapsed and expanded again, these meta edges tend to get destroyed.