test: Increase VM RAM to 2GB

After upgrading to etcd v2, CI was frequently stalling due to high RAM
usage. We do not know the root cause but bumping the RAM solves the
problem.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Merge pull request #667 from flynn/test-vm-ram

test: Increase VM RAM to 2GB
test/cluster: Add fallback mode to DumpLogs

If `flynn-host ps` fails, dump the log files directly.

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>
Merge pull request #669 from flynn/test-dump-fallback

test/cluster: Add fallback mode to DumpLogs
test: Track memory usage in /tmp/debug-info.sh

Signed-off-by: Lewis Marshall <lewis@lmars.net>
Merge pull request #670 from flynn/test-track-memory

test: Track memory usage in /tmp/memwatch.log
all: Move test postgres setup into pkg/testutils

Signed-off-by: Lewis Marshall <lewis@lmars.net>
pkg/queue: Add queue package

Signed-off-by: Lewis Marshall <lewis@lmars.net>
queue: Use discoverd to keep track of the workers.

We cannot use PIDs to check inactivity due to the way database/sql maintains a
pool of connections. Instead, we register the jobs in discoverd, and with a
uuid, and then unlock jobs locked by workers which don't appear in discoverd.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
all: Add johto/notifyutils to dependencies.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
pkg/queue: Use notifydispatcher.

Simplifies our code for using one pq.Listener for many subscribers at once.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
all: Update flynn/pq.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>