DynamoDS/Dynamo — pull request #2778 by Benglin (2014-10-19 06:00:37+00:00)
Title: Fix the indeterminism in task ordering

Background
-----
As of the existing implementation, ```UpdateRenderPackageAsyncTask``` task is considered of equal *weightage* as compared to ```AggregateRenderPackageAsyncTask```, so the order in which they are scheduled will be the order they are executed. The problem is, ```DynamoScheduler.ReprioritizeTasksInQueue``` makes use of ```List.Sort``` method for task ordering, and it is an unstable sort (i.e. the ultimate order of two equivalent tasks are not guaranteed to be the same as the order they originally appeared on the list).

Changes
-----
This pull request fixes such indeterminism in task ordering by replacing ```List.Sort``` with ```Enumerable.OrderBy```, which results in the exact same order if two tasks are considered the same.

Notes to reviewer
-----
Hi @ikeough, please have a go with this one, it retains the behavior as ```List.Sort```, as tested by all unit test cases around ```DynamoScheduler```. Thanks for catching this!