flynn/flynn-controller — pull request #32 by lmars (2014-06-27 23:28:16+00:00)
Title: Generate config per job in the scheduler

We were getting intermittent errors in the scheduler tests:

```
FAIL: scheduler_test.go:173: S.TestWatchFormations

scheduler_test.go:242:
c.Assert(jobCount, Equals, u.jobCount()+1)
... obtained int = 3
... expected int = 2
```

The issue was that when multiple jobs of a given type were started as
part of a single formation update, they all got stored in the
FakeCluster as the same struct because they all used the same config,
so modifying config.ID when starting each job was affecting jobs already
added to the Fake Cluster.

This then meant that removing jobs would either not remove any jobs
because the given ID did not match the ID which all the jobs had (i.e.
the last ID which config.ID was set to), or it would remove all the jobs
because they all had the given ID.

Generating the config per job fixes this.