instead of using a timeout, you can do something like this (assuming we're using promises for the taskrunner):

```javascript
var resolvers = [];
var promises = [];
var results = [];

for (var i = 0; i < 3; i++) {
  promises.push(new Promise(function(resolve, reject) {
    resolvers.push(resolve);
  }));
}

promises.forEach(function(promise, i) {
  taskQueue.push(function() {
    results.push(i);
    return promise;
  });
});

resolvers[1]();
resolvers[0]();
resolvers[2]();

assert.deepEqual(results, [0, 1, 2]);
```