Commit Graph

13 Commits

Author SHA1 Message Date
Martin Atkins 2c70d884d6 dag: node visits return diagnostics rather than errors
This allows node visits to also return warnings.
2018-10-16 18:44:26 -07:00
James Bardin bfa6ab4617 Fix removeEdge test failures
The removeEdge test could fail intermittently with the wrong order.

The precondition of a 1->2->3 order wasn't met, because there was no
edge from 1->3, so 3->1->2 was also a valid ordering.

The other failure was a bookkeeping error, were the recorded order may
not match the visited order. What happened in this case was the gateCh
was closed by V2, allowing V3 to run which could beat V2 to recording
its visit. Now the visit is recorded as part of the vertex walk, and the
gate is released as the final operation.

The order is deterministic now, so remove the brute-force test loop.
2017-02-20 19:54:34 -05:00
James Bardin d01b0b0647 Remove intermittent failure from newEdge test
Because the vertex visit was record after the Update call, Updated
vertices may have been visited before the visit was recorded, causing
occasional test failures.

The order is now deterministic, and we can remove the brute-force loop.
2017-02-20 19:54:34 -05:00
James Bardin 7bf33c2a7f Remove loop from TestWalker_removeVertex
There's no timing dependent behavior here, since V1 must be visited
before V2, Remove and Update must be called before V2 is visited.
2017-02-20 19:54:34 -05:00
James Bardin 0fb24c1a7a Remove sleep-based concurrency from newVertex test
Add a synchronization channel for the TestWalker_newVertex test, rather
than using a sleep and running it multiple times.
2017-02-20 19:54:13 -05:00
Mitchell Hashimoto 6702a22074
dag: require acyclic graph 2017-02-03 21:18:34 +01:00
Mitchell Hashimoto 6366488809
dag: Update can be called with a nil graph 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto 65752cd51a
dag: improve docs and read access during a lock 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto 72a717f2de
dag: change the type sig of Update to Graph so its external friendly 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto 28fff99ea8
dag: replace dag.Walk with our walker 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto 7f61f11723
dag: support removing edges 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto 5d49e7e6b6
dag: tests for adding edges/vertices during walk-time 2017-02-03 21:18:33 +01:00
Mitchell Hashimoto cbc71d9508
dag: basic working update-able walker 2017-02-03 21:18:33 +01:00