shipit-engine 0.4.9 → 0.4.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3a878be449e6b8ac6801539d06921a532b644569
4
- data.tar.gz: 1f9673d4b1b3a295f21aa317830d7d0a599d21b4
3
+ metadata.gz: 210ea31737c07e35be790db7ab4a1f2532e0e0aa
4
+ data.tar.gz: 33451be837eed36d8b6affa99d07945244488aed
5
5
  SHA512:
6
- metadata.gz: 21ddad9052555237832cb01447301f3f4447b2563abb5bc9e45afdaef626f604afe6eb38f46420d3840ead31f0a3d041e64bb47359f895a3f8a502f874edca77
7
- data.tar.gz: bed95b9a9c4adf85a7f8445163ff293103ba218005b0020fe4ba1fc3a5095149686596b96229a58329caf762c84535414077bec22d1774e7e7012214cc20bcf0
6
+ metadata.gz: 731297c1aa312c92cf4e88ec43af43a0e5c3e0a1eac9507064fc6e13c17bc6d1ab7d200d3026ff5ec1bb4aadba4e6d0e99d57a055cd7c28384c6a6a1fb33bb89
7
+ data.tar.gz: 3111e60ed462a6f950dbd7afc175b4d7286586d66abc3574809069e5889c133cdb7e71c253bf33f981eee4597fc5a346882d6ae6596a6b7836d75820a7f2615c
data/app/models/task.rb CHANGED
@@ -151,11 +151,12 @@ class Task < ActiveRecord::Base
151
151
  end
152
152
 
153
153
  def pid
154
- Rails.cache.read("task:#{id}:pid")
154
+ pid = Shipit.redis.get("task:#{id}:pid")
155
+ pid.presence && pid.to_i
155
156
  end
156
157
 
157
158
  def pid=(pid)
158
- Rails.cache.write("task:#{id}:pid", pid, expires_in: 1.hour)
159
+ Shipit.redis.set("task:#{id}:pid", pid, ex: 1.hour.to_i)
159
160
  end
160
161
 
161
162
  def abort!(rollback_once_aborted: false)
@@ -1,3 +1,3 @@
1
1
  module Shipit
2
- VERSION = '0.4.9'
2
+ VERSION = '0.4.10'
3
3
  end
data/lib/shipit.rb CHANGED
@@ -52,8 +52,7 @@ module Shipit
52
52
  end
53
53
 
54
54
  def redis_url
55
- return @redis_url if defined?(@redis_url)
56
- @redis_url = secrets.redis_url.present? ? URI(secrets.redis_url) : nil
55
+ secrets.redis_url.present? ? URI(secrets.redis_url) : nil
57
56
  end
58
57
 
59
58
  def redis(namespace = nil)
Binary file
@@ -1465517,3 +1465517,2743 @@ FetchCommitStatsJobTest: test_#perform_call_#fetch_stats!_on_the_provided_commit
1465517
1465517
  [Redis] command=FLUSHDB args=
1465518
1465518
  [Redis] call_time=0.14 ms
1465519
1465519
   (0.1ms) rollback transaction
1465520
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
1465521
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1465522
+  (0.1ms) begin transaction
1465523
+ Fixture Delete (1.5ms) DELETE FROM "api_clients"
1465524
+ Fixture Insert (0.4ms) INSERT INTO "api_clients" ("name", "permissions", "created_at", "updated_at", "id", "creator_id") VALUES ('Spy', '---
1465525
+ - read:stack
1465526
+ - write:stack
1465527
+ - deploy:stack
1465528
+ - lock:stack
1465529
+ - read:hook
1465530
+ - write:hook
1465531
+ ', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 789626743, 1047960473)
1465532
+ Fixture Insert (0.1ms) INSERT INTO "api_clients" ("name", "permissions", "created_at", "updated_at", "id", "creator_id", "stack_id") VALUES ('Here Come The Walrus', '---
1465533
+ - read:stack
1465534
+ ', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 605148871, 1047960473, 616453971)
1465535
+ Fixture Delete (1.5ms) DELETE FROM "commits"
1465536
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (1, '6d9278037b872fd9a6690523e411ecb3aa181355', 'lets go', '2015-11-24 14:58:05.000000', '2015-11-25 14:58:05.000000', 42, 24, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 616453971, 1047960473, 1047960473)
1465537
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (2, 'f890fd8b5f2be05d1fedb763a3605ee461c39074', 'sheep it!', '2015-11-26 14:58:05.000000', '2015-11-27 14:58:05.000000', 1, 1, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 616453971, 1047960473, 1047960473)
1465538
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (3, '367578b362bf2b4df5903e1c7960929361c39074', 'fix it!', '2015-11-28 14:58:05.000000', '2015-11-29 14:58:05.000000', 12, 64, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 616453971, 1047960473, 1047960473)
1465539
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (4, '467578b362bf2b4df5903e1c7960929361c3435a', '#yoloshipit!', '2015-11-30 14:58:05.000000', '2015-12-01 14:58:05.000000', 420, 342, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 616453971, 1047960473, 1047960473)
1465540
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (5, '567578b362bf2b4df5903e1c7960929361c3abcd', 'fix all teh things', '2015-12-02 14:58:05.000000', '2015-12-03 14:58:05.000000', 1, 24, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 616453971, 1047960473, 1047960473)
1465541
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (6, '8e859b4c19ea7638443d43d612086948bce51701', 'Chips!', '2015-12-02 14:58:05.000000', '2015-12-03 14:58:05.000000', 1, 24, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 805262699, 902541635, 902541635)
1465542
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (7, '44b3833d39def7ec65b57b42f496eb27ab4980b6', 'Cake!', '2015-12-02 14:58:05.000000', '2015-12-03 14:58:05.000000', 1, 24, '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 1068256954, 902541635, 902541635)
1465543
+ Fixture Delete (0.4ms) DELETE FROM "deliveries"
1465544
+ Fixture Insert (0.1ms) INSERT INTO "deliveries" ("event", "status", "url", "content_type", "payload", "created_at", "updated_at", "id", "hook_id") VALUES ('deploy', 'scheduled', 'https://example.com/events/deploy', 'application/json', '{
1465545
+ "stack": {
1465546
+ },
1465547
+ "deploy": {
1465548
+ }
1465549
+ }', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 312741596, 264212040)
1465550
+ Fixture Delete (0.7ms) DELETE FROM "github_hooks"
1465551
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("event", "secret", "github_id", "type", "created_at", "updated_at", "id", "stack_id") VALUES ('push', '1234', 42, 'GithubHook::Repo', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 407351417, 616453971)
1465552
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("event", "secret", "github_id", "type", "created_at", "updated_at", "id", "stack_id") VALUES ('status', '1234', 43, 'GithubHook::Repo', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 1010930799, 616453971)
1465553
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("event", "secret", "type", "created_at", "updated_at", "id", "stack_id") VALUES ('push', '1234', 'GithubHook::Repo', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 1038686235, 805262699)
1465554
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("organization", "event", "secret", "type", "created_at", "updated_at", "id") VALUES ('shopify', 'membership', '1234', 'GithubHook::Organization', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 465236859)
1465555
+ Fixture Delete (0.8ms) DELETE FROM "hooks"
1465556
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('deploy,rollback', 'https://example.com/events/deploy', 'json', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 264212040, 616453971)
1465557
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id") VALUES ('deploy,rollback', 'https://example.com/events/deploy', 'form', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 483377026)
1465558
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('task', 'https://example.com/events/deploy', 'json', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 593914235, 616453971)
1465559
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('commit_status', 'https://example.com/events/commit_status', 'json', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 1045017498, 616453971)
1465560
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('deploy_status', 'https://example.com/events/deploy_status', 'json', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 642664896, 805262699)
1465561
+ Fixture Delete (0.4ms) DELETE FROM "memberships"
1465562
+ Fixture Insert (0.1ms) INSERT INTO "memberships" ("team_id", "created_at", "updated_at", "id", "user_id") VALUES (1, '2015-12-04 14:58:05', '2015-12-04 14:58:05', 111652552, 1047960473)
1465563
+ Fixture Delete (0.7ms) DELETE FROM "output_chunks"
1465564
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('deploy deploy deploy, faiiil', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 616453971, 616453971)
1465565
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Migrating some stuff', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 533999748, 616453971)
1465566
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Compiling all the sass', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 684916759, 616453971)
1465567
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Making ops cry', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 918001080, 616453971)
1465568
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo rm -rf /', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 28353825, 616453971)
1465569
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo chmod -R 777 /', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 414839965, 616453971)
1465570
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Migrating some stuff', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 644540443, 644540443)
1465571
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Compiling all the sass', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 1045986342, 644540443)
1465572
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Making ops cry', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 540862857, 644540443)
1465573
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo rm -rf /', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 389798162, 644540443)
1465574
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo chmod -R 777 /', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 238192810, 644540443)
1465575
+ Fixture Delete (0.6ms) DELETE FROM "stacks"
1465576
+ Fixture Insert (0.1ms) INSERT INTO "stacks" ("repo_owner", "repo_name", "environment", "branch", "ignore_ci", "tasks_count", "undeployed_commits_count", "cached_deploy_spec", "updated_at", "created_at", "id") VALUES ('shopify', 'shipit-engine', 'production', 'master', 't', 3, 1, '{
1465577
+ "machine": {"environment": {}},
1465578
+ "review": {
1465579
+ "checklist": ["foo", "bar", "baz"],
1465580
+ "monitoring": [
1465581
+ {"image": "https://example.com/monitor.png", "width": 200, "height": 300}
1465582
+ ]
1465583
+ },
1465584
+ "dependencies": {"override": []},
1465585
+ "deploy": {"override": null, "variables": [{"name": "SAFETY_DISABLED", "title": "Set to 1 to do dangerous things", "default": 0}]},
1465586
+ "rollback": {"override": ["echo ''Rollback!''"]},
1465587
+ "fetch": ["echo ''42''"],
1465588
+ "tasks": {
1465589
+ "restart": {
1465590
+ "action": "Restart application",
1465591
+ "description": "Restart app and job servers",
1465592
+ "steps": [
1465593
+ "cap $ENVIRONMENT deploy:restart"
1465594
+ ]
1465595
+ }
1465596
+ },
1465597
+ "ci": {
1465598
+ "hide": ["ci/hidden"],
1465599
+ "allow_failures": ["ci/ok_to_fail"]
1465600
+ }
1465601
+ }
1465602
+ ', '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 616453971)
1465603
+ Fixture Insert (0.1ms) INSERT INTO "stacks" ("repo_owner", "repo_name", "environment", "branch", "ignore_ci", "tasks_count", "undeployed_commits_count", "cached_deploy_spec", "updated_at", "created_at", "id") VALUES ('george', 'cyclimse', 'production', 'master', 'f', 0, 1, '{
1465604
+ "machine": {"environment": {}},
1465605
+ "review": {
1465606
+ "checklist": ["foo", "bar", "baz"],
1465607
+ "monitoring": [
1465608
+ {"image": "https://example.com/monitor.png", "width": 200, "height": 300}
1465609
+ ]
1465610
+ },
1465611
+ "dependencies": {"override": []},
1465612
+ "deploy": {"override": null},
1465613
+ "rollback": {"override": ["echo ''Rollback!''"]},
1465614
+ "fetch": ["echo ''42''"],
1465615
+ "tasks": {
1465616
+ "restart": {
1465617
+ "action": "Restart application",
1465618
+ "description": "Restart app and job servers",
1465619
+ "steps": [
1465620
+ "cap $ENVIRONMENT deploy:restart"
1465621
+ ]
1465622
+ }
1465623
+ }
1465624
+ }
1465625
+ ', '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 805262699)
1465626
+ Fixture Insert (0.1ms) INSERT INTO "stacks" ("repo_owner", "repo_name", "environment", "branch", "ignore_ci", "tasks_count", "undeployed_commits_count", "cached_deploy_spec", "updated_at", "created_at", "id") VALUES ('shopify', 'foo-bar', 'production', 'master', 't', 0, 1, '{
1465627
+ "machine": {"environment": {}},
1465628
+ "review": {
1465629
+ "checklist": ["foo", "bar", "baz"],
1465630
+ "monitoring": [
1465631
+ {"image": "https://example.com/monitor.png", "width": 200, "height": 300}
1465632
+ ]
1465633
+ },
1465634
+ "dependencies": {"override": []},
1465635
+ "deploy": {"override": null},
1465636
+ "rollback": {"override": ["echo ''Rollback!''"]},
1465637
+ "fetch": ["echo ''42''"],
1465638
+ "tasks": {
1465639
+ "restart": {
1465640
+ "action": "Restart application",
1465641
+ "description": "Restart app and job servers",
1465642
+ "steps": [
1465643
+ "cap $ENVIRONMENT deploy:restart"
1465644
+ ]
1465645
+ }
1465646
+ },
1465647
+ "ci": {
1465648
+ "hide": ["ci/hidden"],
1465649
+ "allow_failures": ["ci/ok_to_fail"]
1465650
+ }
1465651
+ }
1465652
+ ', '2015-11-26 14:58:05.000000', '2015-12-04 14:58:05', 1068256954)
1465653
+ Fixture Delete (0.6ms) DELETE FROM "statuses"
1465654
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (1, 'lets go', 'ci/travis', '2015-11-24 14:58:05.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:05', 123278920)
1465655
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'ci/travis', '2015-11-24 14:58:05.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:05', 434006389)
1465656
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'metrics/coveralls', '2015-11-24 14:58:05.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:05', 480414295)
1465657
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'ci/travis', '2015-11-25 14:58:05.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:05', 426673251)
1465658
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'metrics/coveralls', '2015-11-25 14:58:05.000000', 'failure', 'http://www.example.com', '2015-12-04 14:58:05', 795737880)
1465659
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (3, 'lets go', 'ci/travis', '2015-11-25 14:58:05.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:05', 655320231)
1465660
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (3, 'lets go', 'metrics/coveralls', '2015-11-25 14:58:05.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:05', 387423564)
1465661
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (4, 'lets go', 'ci/travis', '2015-11-25 14:58:05.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:05', 432368261)
1465662
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (4, 'lets go', 'metrics/coveralls', '2015-11-25 14:58:05.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:05', 867194541)
1465663
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (6, 'lets go', 'ci/travis', '2015-11-25 14:58:05.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:05', 1045681328)
1465664
+ Fixture Delete (0.5ms) DELETE FROM "tasks"
1465665
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (1, 2, 'Deploy', 'success', 1, 1, '2015-12-04 13:59:05.000000', '2015-12-04 14:58:05', 616453971, 1047960473, 616453971)
1465666
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (2, 3, 'Deploy', 'failed', 12, 64, '2015-12-04 14:00:05.000000', '2015-12-04 14:58:05', 533999748, 1047960473, 616453971)
1465667
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "definition", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (2, 2, 'Task', 'success', '{
1465668
+ "id": "restart",
1465669
+ "action": "Restart application",
1465670
+ "description": "Restart app and job servers",
1465671
+ "steps": [
1465672
+ "cap $ENVIRONMENT deploy:restart"
1465673
+ ]
1465674
+ }
1465675
+ ', '2015-12-04 14:01:05.000000', '2015-12-04 14:58:05', 783434608, 1047960473, 616453971)
1465676
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "stack_id") VALUES (2, 4, 'Deploy', 'pending', 432, 406, '2015-12-04 14:02:05.000000', '2015-12-04 14:58:05', 496901070, 616453971)
1465677
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (3, 4, 'Deploy', 'running', 420, 342, '2015-12-04 14:03:05.000000', '2015-12-04 14:58:05', 644540443, 1047960473, 616453971)
1465678
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (3, 4, 'Deploy', 'success', 420, 342, '2015-12-04 14:04:05.000000', '2015-12-04 14:58:05', 214925279, 902541635, 616453971)
1465679
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "rollback_once_aborted", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (3, 4, 'Deploy', 'aborted', 420, 342, 't', '2015-12-04 14:05:05.000000', '2015-12-04 14:58:05', 656614832, 902541635, 616453971)
1465680
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id", "parent_id") VALUES (3, 4, 'Rollback', 'aborted', 420, 342, '2015-12-04 14:06:05.000000', '2015-12-04 14:58:05', 394236209, 902541635, 616453971, 656614832)
1465681
+ Fixture Delete (0.7ms) DELETE FROM "teams"
1465682
+ Fixture Insert (0.1ms) INSERT INTO "teams" ("id", "github_id", "organization", "slug", "name", "api_url", "created_at", "updated_at") VALUES (1, 1, 'shopify', 'developers', 'Developers', 'https://example.com/shopify/developers', '2015-12-04 14:58:05', '2015-12-04 14:58:05')
1465683
+ Fixture Insert (0.1ms) INSERT INTO "teams" ("id", "github_id", "organization", "slug", "name", "api_url", "created_at", "updated_at") VALUES (2, 2, 'cyclimse', 'cooks', 'Cooks', 'https://example.com/cyclimse/cooks', '2015-12-04 14:58:05', '2015-12-04 14:58:05')
1465684
+ Fixture Delete (0.4ms) DELETE FROM "users"
1465685
+ Fixture Insert (0.1ms) INSERT INTO "users" ("name", "email", "login", "created_at", "updated_at", "id") VALUES ('Lando Walrussian', 'walrus@shopify.com', 'walrus', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 1047960473)
1465686
+ Fixture Insert (0.1ms) INSERT INTO "users" ("name", "email", "github_id", "login", "created_at", "updated_at", "id") VALUES ('Bob the Builder', 'bob@bob.com', 1234, 'bob', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 902541635)
1465687
+ Fixture Insert (0.1ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at", "id") VALUES ('Anonymous Legion', 'anonymous@example.com', '2015-12-04 14:58:05', '2015-12-04 14:58:05', 36826545)
1465688
+  (1.6ms) commit transaction
1465689
+  (0.1ms) begin transaction
1465690
+ --------------------------------------------------------------------------------------------------------------
1465691
+ DeploysTest: test_#reject!_first_transition_to_flapping_then_ultimately_to_failed_if_the_deploy_was_successful
1465692
+ --------------------------------------------------------------------------------------------------------------
1465693
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465694
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465695
+ [Redis] command=SELECT args=7
1465696
+ [Redis] call_time=34.02 ms
1465697
+ [Redis] call_time=40.21 ms
1465698
+ Stack Load (0.2ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465699
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465700
+  (0.0ms) SAVEPOINT active_record_1
1465701
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "flapping"], ["updated_at", "2015-12-04 14:58:05.646825"], ["id", 616453971]]
1465702
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465703
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.659533' WHERE "stacks"."id" = ? [["id", 616453971]]
1465704
+ SQL (1.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -1], ["updated_at", "2015-12-04 14:58:05.662505"], ["id", 616453971]]
1465705
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.664782' WHERE "stacks"."id" = ? [["id", 616453971]]
1465706
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465707
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1465708
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1465709
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465710
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465711
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 96cea3fd-7fb3-4729-99de-925b4d1b9470) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"flapping\",\"updated_at\":\"2015-12-04T14:58:05.662Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"flapping\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.664Z\"}}"}
1465712
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465713
+  (0.0ms) SAVEPOINT active_record_1
1465714
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -2], ["updated_at", "2015-12-04 14:58:05.714350"], ["id", 616453971]]
1465715
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.715598' WHERE "stacks"."id" = ? [["id", 616453971]]
1465716
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465717
+  (0.0ms) SAVEPOINT active_record_1
1465718
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -3], ["updated_at", "2015-12-04 14:58:05.718323"], ["id", 616453971]]
1465719
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.719281' WHERE "stacks"."id" = ? [["id", 616453971]]
1465720
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465721
+  (0.0ms) SAVEPOINT active_record_1
1465722
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -4], ["updated_at", "2015-12-04 14:58:05.721743"], ["id", 616453971]]
1465723
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.722705' WHERE "stacks"."id" = ? [["id", 616453971]]
1465724
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1465725
+  (0.0ms) SAVEPOINT active_record_1
1465726
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -5], ["updated_at", "2015-12-04 14:58:05.725128"], ["id", 616453971]]
1465727
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.726037' WHERE "stacks"."id" = ? [["id", 616453971]]
1465728
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "failed"], ["updated_at", "2015-12-04 14:58:05.727410"], ["id", 616453971]]
1465729
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.728358' WHERE "stacks"."id" = ? [["id", 616453971]]
1465730
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 0d7cd85f-1321-4108-bd4a-fb18cf4d65bf) to Test(default) with arguments: gid://shipit/Stack/616453971
1465731
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 51787930-07f4-4598-ad45-00c001df25cc) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"failed\",\"updated_at\":\"2015-12-04T14:58:05.727Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"failed\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.728Z\"}}"}
1465732
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465733
+ [Redis] command=FLUSHDB args=
1465734
+ [Redis] call_time=0.17 ms
1465735
+  (22.2ms) rollback transaction
1465736
+  (0.1ms) begin transaction
1465737
+ ----------------------------------------------------------------------
1465738
+ DeploysTest: test_abort!_still_succeeds_if_the_process_is_already_dead
1465739
+ ----------------------------------------------------------------------
1465740
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465741
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465742
+ [Redis] call_time=0.28 ms
1465743
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465744
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465745
+ [Redis] command=GET args="task:616453971:pid"
1465746
+ [Redis] call_time=0.26 ms
1465747
+ [Redis] command=GET args="task:616453971:pid"
1465748
+ [Redis] call_time=0.18 ms
1465749
+  (0.1ms) SAVEPOINT active_record_1
1465750
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465751
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465752
+  (0.0ms) SAVEPOINT active_record_1
1465753
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:05.766321"], ["id", 616453971]]
1465754
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.768001' WHERE "stacks"."id" = ? [["id", 616453971]]
1465755
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465756
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1465757
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1465758
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465759
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465760
+ [ActiveJob] Enqueued EmitEventJob (Job ID: e2014f4c-f303-473e-b287-e9b277e66c0a) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:05.766Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.768Z\"}}"}
1465761
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465762
+  (0.0ms) SAVEPOINT active_record_1
1465763
+ SQL (0.2ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:05.782097"], ["updated_at", "2015-12-04 14:58:05.782097"]]
1465764
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1465765
+  (0.0ms) SAVEPOINT active_record_1
1465766
+ SQL (0.3ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: PID 42 ESRCH: No such process\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:05.783951"], ["updated_at", "2015-12-04 14:58:05.783951"]]
1465767
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1465768
+  (0.0ms) SAVEPOINT active_record_1
1465769
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborted"], ["updated_at", "2015-12-04 14:58:05.786981"], ["id", 616453971]]
1465770
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.788788' WHERE "stacks"."id" = ? [["id", 616453971]]
1465771
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d2f2d103-76f0-4334-bc48-1dacbc1a3ab8) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborted\",\"updated_at\":\"2015-12-04T14:58:05.786Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborted\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.788Z\"}}"}
1465772
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465773
+ [Redis] command=FLUSHDB args=
1465774
+ [Redis] call_time=0.14 ms
1465775
+  (0.6ms) rollback transaction
1465776
+  (0.0ms) begin transaction
1465777
+ ----------------------------------------------------
1465778
+ DeploysTest: test_#build_rollback_returns_a_rollback
1465779
+ ----------------------------------------------------
1465780
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465781
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465782
+ [Redis] call_time=0.15 ms
1465783
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465784
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465785
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465786
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1465787
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1465788
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1465789
+ [Redis] command=FLUSHDB args=
1465790
+ [Redis] call_time=0.17 ms
1465791
+  (0.1ms) rollback transaction
1465792
+  (0.0ms) begin transaction
1465793
+ ------------------------------------------------------------------------
1465794
+ DeploysTest: test_#since_commit_id_returns_the_database_value_if_present
1465795
+ ------------------------------------------------------------------------
1465796
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465797
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465798
+ [Redis] call_time=0.16 ms
1465799
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465800
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465801
+ [Redis] command=FLUSHDB args=
1465802
+ [Redis] call_time=0.11 ms
1465803
+  (0.0ms) rollback transaction
1465804
+  (0.0ms) begin transaction
1465805
+ ---------------------------------------------------
1465806
+ DeploysTest: test_#trigger_rollback_locks_the_stack
1465807
+ ---------------------------------------------------
1465808
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465809
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465810
+ [Redis] call_time=0.14 ms
1465811
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465812
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465813
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465814
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1465815
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1465816
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1465817
+  (0.0ms) SAVEPOINT active_record_1
1465818
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465819
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1465820
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:05.867773"], ["updated_at", "2015-12-04 14:58:05.867773"], ["additions", 432], ["deletions", 406]]
1465821
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1465822
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.871458' WHERE "stacks"."id" = ? [["id", 616453971]]
1465823
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465824
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: f9804e3e-2746-49ba-a087-c4a901cf477a) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1465825
+  (0.0ms) SAVEPOINT active_record_1
1465826
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1465827
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:05.880130"], ["id", 616453971]]
1465828
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465829
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d0c056d3-ec75-4cad-a1a4-5da52ba433a7) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.880Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}}"}
1465830
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465831
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465832
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465833
+ [Redis] command=FLUSHDB args=
1465834
+ [Redis] call_time=0.20 ms
1465835
+  (0.9ms) rollback transaction
1465836
+  (0.1ms) begin transaction
1465837
+ ---------------------------------------------------------------------
1465838
+ DeploysTest: test_creating_a_deploy_causes_an_event_to_be_broadcasted
1465839
+ ---------------------------------------------------------------------
1465840
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465841
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465842
+ [Redis] call_time=0.31 ms
1465843
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465844
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465845
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? ORDER BY "commits"."id" ASC LIMIT 1 [["stack_id", 616453971]]
1465846
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? ORDER BY "commits"."id" DESC LIMIT 1 [["stack_id", 616453971]]
1465847
+  (0.1ms) SAVEPOINT active_record_1
1465848
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465849
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 5) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1465850
+ SQL (0.5ms) INSERT INTO "tasks" ("type", "since_commit_id", "until_commit_id", "stack_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["type", "Deploy"], ["since_commit_id", 1], ["until_commit_id", 5], ["stack_id", 616453971], ["created_at", "2015-12-04 14:58:05.901067"], ["updated_at", "2015-12-04 14:58:05.901067"], ["additions", 434], ["deletions", 431]]
1465851
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1465852
+ SQL (0.4ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.905863' WHERE "stacks"."id" = ? [["id", 616453971]]
1465853
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465854
+ [Redis] command=FLUSHDB args=
1465855
+ [Redis] call_time=0.21 ms
1465856
+  (0.7ms) rollback transaction
1465857
+  (0.0ms) begin transaction
1465858
+ ------------------------------------------------------------------------------------
1465859
+ DeploysTest: test_transitioning_to_failure_schedule_a_fetch_of_the_deployed_revision
1465860
+ ------------------------------------------------------------------------------------
1465861
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465862
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465863
+ [Redis] call_time=0.17 ms
1465864
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465865
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465866
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1465867
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465868
+  (0.0ms) SAVEPOINT active_record_1
1465869
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "failed"], ["updated_at", "2015-12-04 14:58:05.913935"], ["id", 644540443]]
1465870
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.915235' WHERE "stacks"."id" = ? [["id", 616453971]]
1465871
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 830d0773-31ce-4d69-96d4-aaa5a6022b10) to Test(default) with arguments: gid://shipit/Stack/616453971
1465872
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465873
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1465874
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1465875
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465876
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465877
+ [ActiveJob] Enqueued EmitEventJob (Job ID: de1dd96d-fce3-4c7d-bc8c-ea50864b30d8) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"failed\",\"updated_at\":\"2015-12-04T14:58:05.913Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"failed\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.915Z\"}}"}
1465878
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465879
+ [Redis] command=FLUSHDB args=
1465880
+ [Redis] call_time=0.17 ms
1465881
+  (0.5ms) rollback transaction
1465882
+  (0.0ms) begin transaction
1465883
+ --------------------------------------------
1465884
+ DeploysTest: test_enqueue_when_not_persisted
1465885
+ --------------------------------------------
1465886
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465887
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465888
+ [Redis] call_time=0.22 ms
1465889
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465890
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465891
+ [Redis] command=FLUSHDB args=
1465892
+ [Redis] call_time=0.14 ms
1465893
+  (0.1ms) rollback transaction
1465894
+  (0.0ms) begin transaction
1465895
+ ----------------------------------------------------------------------
1465896
+ DeploysTest: test_#chunk_output_returns_logs_from_records_if_rolled_up
1465897
+ ----------------------------------------------------------------------
1465898
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465899
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465900
+ [Redis] call_time=0.15 ms
1465901
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465902
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465903
+  (0.1ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1465904
+  (0.0ms) SAVEPOINT active_record_1
1465905
+  (0.0ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1465906
+ SQL (0.3ms) DELETE FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1465907
+ SQL (0.1ms) UPDATE "tasks" SET "gzip_output" = ?, "rolled_up" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["gzip_output", "<110 bytes of binary data>"], ["rolled_up", "t"], ["updated_at", "2015-12-04 14:58:05.936798"], ["id", 616453971]]
1465908
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465909
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.938726' WHERE "stacks"."id" = ? [["id", 616453971]]
1465910
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465911
+ [Redis] command=FLUSHDB args=
1465912
+ [Redis] call_time=0.16 ms
1465913
+  (0.5ms) rollback transaction
1465914
+  (0.1ms) begin transaction
1465915
+ ----------------------------------------------------------------------------
1465916
+ DeploysTest: test_transitioning_to_running_causes_an_event_to_be_broadcasted
1465917
+ ----------------------------------------------------------------------------
1465918
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465919
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465920
+ [Redis] call_time=0.14 ms
1465921
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465922
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465923
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1465924
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465925
+  (0.0ms) SAVEPOINT active_record_1
1465926
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "running"], ["updated_at", "2015-12-04 14:58:05.947388"], ["id", 496901070]]
1465927
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.948765' WHERE "stacks"."id" = ? [["id", 616453971]]
1465928
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1465929
+ [Redis] command=FLUSHDB args=
1465930
+ [Redis] call_time=0.28 ms
1465931
+  (0.5ms) rollback transaction
1465932
+  (0.1ms) begin transaction
1465933
+ -----------------------------------
1465934
+ DeploysTest: test_working_directory
1465935
+ -----------------------------------
1465936
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465937
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465938
+ [Redis] call_time=0.18 ms
1465939
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465940
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465941
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465942
+ [Redis] command=FLUSHDB args=
1465943
+ [Redis] call_time=0.12 ms
1465944
+  (0.1ms) rollback transaction
1465945
+  (0.0ms) begin transaction
1465946
+ ------------------------------------------------------------------------------------
1465947
+ DeploysTest: test_transitioning_to_success_skips_CD_deploy_when_stack_doesn't_use_it
1465948
+ ------------------------------------------------------------------------------------
1465949
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465950
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465951
+ [Redis] call_time=0.15 ms
1465952
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465953
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465954
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1465955
+  (0.0ms) SAVEPOINT active_record_1
1465956
+ SQL (0.3ms) INSERT INTO "statuses" ("state", "commit_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["state", "success"], ["commit_id", 5], ["created_at", "2015-12-04 14:58:05.964849"], ["updated_at", "2015-12-04 14:58:05.964849"]]
1465957
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1465958
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465959
+ SQL (0.2ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:05.969483' WHERE "commits"."id" = ? [["id", 5]]
1465960
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.970739' WHERE "stacks"."id" = ? [["id", 616453971]]
1465961
+ SQL (0.4ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.971679' WHERE "stacks"."id" = ? [["id", 616453971]]
1465962
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:05.973262' WHERE "commits"."id" = ? [["id", 5]]
1465963
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.974018' WHERE "stacks"."id" = ? [["id", 616453971]]
1465964
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.974662' WHERE "stacks"."id" = ? [["id", 616453971]]
1465965
+ Status Load (0.3ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" = ? ORDER BY "statuses"."created_at" DESC [["commit_id", 5]]
1465966
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465967
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1465968
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1465969
+  (0.1ms) SAVEPOINT active_record_1
1465970
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:05.984656"], ["id", 644540443]]
1465971
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465972
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:05.986719' WHERE "stacks"."id" = ? [["id", 616453971]]
1465973
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: d062a1a6-f505-49a2-ae44-1c851c67eed4) to Test(default) with arguments: gid://shipit/Stack/616453971
1465974
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1465975
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1465976
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465977
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1465978
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465979
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465980
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 8cb84a87-8bc6-49aa-addb-3efc6ce70008) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:05.984Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.986Z\"}}"}
1465981
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1465982
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1465983
+ [Redis] command=FLUSHDB args=
1465984
+ [Redis] call_time=0.16 ms
1465985
+  (0.9ms) rollback transaction
1465986
+  (0.0ms) begin transaction
1465987
+ ----------------------------------------------------
1465988
+ DeploysTest: test_abort!_bails_out_if_the_PID_is_nil
1465989
+ ----------------------------------------------------
1465990
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1465991
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1465992
+ [Redis] call_time=0.24 ms
1465993
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1465994
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1465995
+ [Redis] command=SET args="task:616453971:pid" "" "EX" 3600
1465996
+ [Redis] call_time=0.19 ms
1465997
+ [Redis] command=GET args="task:616453971:pid"
1465998
+ [Redis] call_time=0.13 ms
1465999
+  (0.1ms) SAVEPOINT active_record_1
1466000
+ SQL (0.2ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: failed, PID unknown\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:06.004339"], ["updated_at", "2015-12-04 14:58:06.004339"]]
1466001
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466002
+ [Redis] command=FLUSHDB args=
1466003
+ [Redis] call_time=0.16 ms
1466004
+  (0.3ms) rollback transaction
1466005
+  (0.0ms) begin transaction
1466006
+ ---------------------------------------------------------------------
1466007
+ DeploysTest: test_#build_rollback_set_the_id_of_the_rollbacked_deploy
1466008
+ ---------------------------------------------------------------------
1466009
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466010
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466011
+ [Redis] call_time=0.14 ms
1466012
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466013
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466014
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466015
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466016
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466017
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466018
+ [Redis] command=FLUSHDB args=
1466019
+ [Redis] call_time=0.23 ms
1466020
+  (0.1ms) rollback transaction
1466021
+  (0.0ms) begin transaction
1466022
+ -----------------------------------------------------
1466023
+ DeploysTest: test_#trigger_rollback_schedule_the_task
1466024
+ -----------------------------------------------------
1466025
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466026
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466027
+ [Redis] call_time=0.14 ms
1466028
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466029
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466030
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466031
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466032
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466033
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466034
+  (0.0ms) SAVEPOINT active_record_1
1466035
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466036
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466037
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:06.019003"], ["updated_at", "2015-12-04 14:58:06.019003"], ["additions", 432], ["deletions", 406]]
1466038
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466039
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.022325' WHERE "stacks"."id" = ? [["id", 616453971]]
1466040
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466041
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 6bc52c30-851f-45a8-8e69-e03a55a21d6c) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1466042
+  (0.1ms) SAVEPOINT active_record_1
1466043
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466044
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:06.028271"], ["id", 616453971]]
1466045
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466046
+ [Redis] command=FLUSHDB args=
1466047
+ [Redis] call_time=0.15 ms
1466048
+  (0.6ms) rollback transaction
1466049
+  (0.0ms) begin transaction
1466050
+ -----------------------------------------------------------------------------------------------------------
1466051
+ DeploysTest: test_#accept!_first_transition_to_flapping_then_ultimately_to_success_if_the_deploy_was_failed
1466052
+ -----------------------------------------------------------------------------------------------------------
1466053
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466054
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466055
+ [Redis] call_time=0.21 ms
1466056
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466057
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466058
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 533999748]]
1466059
+  (0.0ms) SAVEPOINT active_record_1
1466060
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "flapping"], ["updated_at", "2015-12-04 14:58:06.036292"], ["id", 533999748]]
1466061
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466062
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.038121' WHERE "stacks"."id" = ? [["id", 616453971]]
1466063
+ SQL (0.3ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 1], ["updated_at", "2015-12-04 14:58:06.040028"], ["id", 533999748]]
1466064
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.041076' WHERE "stacks"."id" = ? [["id", 616453971]]
1466065
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466066
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1466067
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 3) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466068
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466069
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466070
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 93494f02-0f30-419f-806e-1a1e1e1d26af) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":533999748,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/533999748\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748/output\",\"type\":\"deploy\",\"status\":\"flapping\",\"updated_at\":\"2015-12-04T14:58:06.040Z\",\"created_at\":\"2015-12-04T14:00:05.000Z\",\"additions\":12,\"deletions\":64,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:05.000Z\",\"committed_at\":\"2015-11-29T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"flapping\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.041Z\"}}"}
1466071
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466072
+  (0.1ms) SAVEPOINT active_record_1
1466073
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 2], ["updated_at", "2015-12-04 14:58:06.057400"], ["id", 533999748]]
1466074
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.059044' WHERE "stacks"."id" = ? [["id", 616453971]]
1466075
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466076
+  (0.0ms) SAVEPOINT active_record_1
1466077
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 3], ["updated_at", "2015-12-04 14:58:06.062170"], ["id", 533999748]]
1466078
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.063183' WHERE "stacks"."id" = ? [["id", 616453971]]
1466079
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466080
+  (0.1ms) SAVEPOINT active_record_1
1466081
+ SQL (0.0ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 4], ["updated_at", "2015-12-04 14:58:06.065596"], ["id", 533999748]]
1466082
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.066485' WHERE "stacks"."id" = ? [["id", 616453971]]
1466083
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466084
+  (0.0ms) SAVEPOINT active_record_1
1466085
+ SQL (0.0ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 5], ["updated_at", "2015-12-04 14:58:06.068879"], ["id", 533999748]]
1466086
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.069748' WHERE "stacks"."id" = ? [["id", 616453971]]
1466087
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.070844"], ["id", 533999748]]
1466088
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.071723' WHERE "stacks"."id" = ? [["id", 616453971]]
1466089
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: e44742ac-34f5-461f-a0bd-1fde62e2bad4) to Test(default) with arguments: gid://shipit/Stack/616453971
1466090
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 3)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466091
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 6d3930f8-8ee9-401a-9840-2cc86af65311) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":533999748,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/533999748\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:06.070Z\",\"created_at\":\"2015-12-04T14:00:05.000Z\",\"additions\":12,\"deletions\":64,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:05.000Z\",\"committed_at\":\"2015-11-29T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.071Z\"}}"}
1466092
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466093
+ [Redis] command=FLUSHDB args=
1466094
+ [Redis] call_time=0.16 ms
1466095
+  (0.7ms) rollback transaction
1466096
+  (0.1ms) begin transaction
1466097
+ ---------------------------------------------------------------------------
1466098
+ DeploysTest: test_additions_and_deletions_are_denormalized_on_before_create
1466099
+ ---------------------------------------------------------------------------
1466100
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466101
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466102
+ [Redis] call_time=0.14 ms
1466103
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466104
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466105
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1466106
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1466107
+  (0.0ms) SAVEPOINT active_record_1
1466108
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466109
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 3) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466110
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "since_commit_id", "until_commit_id", "stack_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["type", "Deploy"], ["since_commit_id", 1], ["until_commit_id", 3], ["stack_id", 616453971], ["created_at", "2015-12-04 14:58:06.086298"], ["updated_at", "2015-12-04 14:58:06.086298"], ["additions", 13], ["deletions", 65]]
1466111
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466112
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.089662' WHERE "stacks"."id" = ? [["id", 616453971]]
1466113
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466114
+ [Redis] command=FLUSHDB args=
1466115
+ [Redis] call_time=0.10 ms
1466116
+  (0.7ms) rollback transaction
1466117
+  (0.0ms) begin transaction
1466118
+ ------------------------------------------------------------------------
1466119
+ DeploysTest: test_#accept!_bails_out_if_the_deploy_is_successful_already
1466120
+ ------------------------------------------------------------------------
1466121
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466122
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466123
+ [Redis] call_time=0.23 ms
1466124
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466125
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466126
+ [Redis] command=FLUSHDB args=
1466127
+ [Redis] call_time=0.12 ms
1466128
+  (0.0ms) rollback transaction
1466129
+  (0.0ms) begin transaction
1466130
+ ----------------------------------
1466131
+ DeploysTest: test_pid_is_persisted
1466132
+ ----------------------------------
1466133
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466134
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466135
+ [Redis] call_time=0.13 ms
1466136
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466137
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466138
+ Deploy Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466139
+ [Redis] command=GET args="task:616453971:pid"
1466140
+ [Redis] call_time=0.18 ms
1466141
+ [Redis] command=FLUSHDB args=
1466142
+ [Redis] call_time=0.12 ms
1466143
+  (0.0ms) rollback transaction
1466144
+  (0.0ms) begin transaction
1466145
+ -------------------------
1466146
+ DeploysTest: test_enqueue
1466147
+ -------------------------
1466148
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466149
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466150
+ [Redis] call_time=0.16 ms
1466151
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466152
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466153
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 86629e63-a0ae-4d7b-b809-6b1063012972) to Test(deploys) with arguments: gid://shipit/Deploy/616453971
1466154
+ [Redis] command=FLUSHDB args=
1466155
+ [Redis] call_time=0.17 ms
1466156
+  (0.0ms) rollback transaction
1466157
+  (0.0ms) begin transaction
1466158
+ -----------------------------------------------------------------------
1466159
+ DeploysTest: test_#trigger_rollback_rolls_the_stack_back_to_this_deploy
1466160
+ -----------------------------------------------------------------------
1466161
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466162
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466163
+ [Redis] call_time=0.14 ms
1466164
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466165
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466166
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466167
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466168
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466169
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466170
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466171
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466172
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466173
+  (0.0ms) SAVEPOINT active_record_1
1466174
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466175
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466176
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:06.110784"], ["updated_at", "2015-12-04 14:58:06.110784"], ["additions", 432], ["deletions", 406]]
1466177
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466178
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.113938' WHERE "stacks"."id" = ? [["id", 616453971]]
1466179
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466180
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 8c99af77-1bd3-47a5-918a-ec310dbc1300) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1466181
+  (0.1ms) SAVEPOINT active_record_1
1466182
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466183
+ SQL (0.2ms) UPDATE "stacks" SET "lock_reason" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["updated_at", "2015-12-04 14:58:06.118934"], ["id", 616453971]]
1466184
+ [ActiveJob] Enqueued EmitEventJob (Job ID: edd65859-c49b-4518-872b-e62f8a98e55e) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.118Z\",\"lock_author\":{\"id\":null,\"name\":\"Anonymous\",\"email\":\"anonymous@example.com\",\"login\":\"anonymous\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"created_at\":\"1970-01-01T00:00:00.000Z\",\"updated_at\":\"1970-01-01T00:00:00.000Z\"}}}"}
1466185
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466186
+  (0.0ms) SAVEPOINT active_record_1
1466187
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "running"], ["updated_at", "2015-12-04 14:58:06.124947"], ["id", 783434609]]
1466188
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.126416' WHERE "stacks"."id" = ? [["id", 616453971]]
1466189
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466190
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466191
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466192
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466193
+ [ActiveJob] Enqueued EmitEventJob (Job ID: b84014b1-af57-4d36-8308-acd6e058954e) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"running\",\"updated_at\":\"2015-12-04T14:58:06.124Z\",\"created_at\":\"2015-12-04T14:58:06.110Z\",\"additions\":432,\"deletions\":406,\"author\":{\"id\":null,\"name\":\"Anonymous\",\"email\":\"anonymous@example.com\",\"login\":\"anonymous\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"created_at\":\"1970-01-01T00:00:00.000Z\",\"updated_at\":\"1970-01-01T00:00:00.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:05.000Z\",\"committed_at\":\"2015-11-29T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}},{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"running\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.126Z\"}}"}
1466194
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466195
+  (0.0ms) SAVEPOINT active_record_1
1466196
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.138363"], ["id", 783434609]]
1466197
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.139437' WHERE "stacks"."id" = ? [["id", 616453971]]
1466198
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: ff93c7cb-f782-4888-b47b-2e08fcc910ec) to Test(default) with arguments: gid://shipit/Stack/616453971
1466199
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 2)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466200
+ [ActiveJob] Enqueued EmitEventJob (Job ID: f9e6ed5b-0722-447c-a59b-a6d87da9fac5) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:06.138Z\",\"created_at\":\"2015-12-04T14:58:06.110Z\",\"additions\":432,\"deletions\":406,\"author\":{\"id\":null,\"name\":\"Anonymous\",\"email\":\"anonymous@example.com\",\"login\":\"anonymous\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"created_at\":\"1970-01-01T00:00:00.000Z\",\"updated_at\":\"1970-01-01T00:00:00.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:05.000Z\",\"committed_at\":\"2015-11-29T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}},{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.139Z\"}}"}
1466201
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466202
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466203
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466204
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466205
+ [Redis] command=FLUSHDB args=
1466206
+ [Redis] call_time=0.19 ms
1466207
+  (0.7ms) rollback transaction
1466208
+  (0.1ms) begin transaction
1466209
+ --------------------------------------------------------------------------
1466210
+ DeploysTest: test_transitioning_to_aborted_schedule_a_rollback_if_required
1466211
+ --------------------------------------------------------------------------
1466212
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466213
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466214
+ [Redis] call_time=0.20 ms
1466215
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466216
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466217
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1466218
+ [Redis] command=SET args="task:644540443:pid" "42" "EX" 3600
1466219
+ [Redis] call_time=0.17 ms
1466220
+ [Redis] command=GET args="task:644540443:pid"
1466221
+ [Redis] call_time=0.18 ms
1466222
+  (0.1ms) SAVEPOINT active_record_1
1466223
+ SQL (0.3ms) UPDATE "tasks" SET "rollback_once_aborted" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["rollback_once_aborted", "t"], ["updated_at", "2015-12-04 14:58:06.156883"], ["id", 644540443]]
1466224
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466225
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.159016' WHERE "stacks"."id" = ? [["id", 616453971]]
1466226
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466227
+  (0.1ms) SAVEPOINT active_record_1
1466228
+ SQL (0.4ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:06.162485"], ["id", 644540443]]
1466229
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.164047' WHERE "stacks"."id" = ? [["id", 616453971]]
1466230
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466231
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466232
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466233
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466234
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466235
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d4ddac46-6f2f-4d71-bfcc-718ba1b38288) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:06.162Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.164Z\"}}"}
1466236
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466237
+  (0.0ms) SAVEPOINT active_record_1
1466238
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:06.173727"], ["updated_at", "2015-12-04 14:58:06.173727"]]
1466239
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466240
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback') AND "tasks"."stack_id" = ? [["stack_id", 616453971]]
1466241
+  (0.0ms) SAVEPOINT active_record_1
1466242
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborted"], ["updated_at", "2015-12-04 14:58:06.177516"], ["id", 644540443]]
1466243
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.178579' WHERE "stacks"."id" = ? [["id", 616453971]]
1466244
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1466245
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466246
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466247
+ SQL (0.1ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 644540443], ["since_commit_id", 4], ["until_commit_id", 3], ["created_at", "2015-12-04 14:58:06.181085"], ["updated_at", "2015-12-04 14:58:06.181085"], ["additions", 420], ["deletions", 342]]
1466248
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466249
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.184363' WHERE "stacks"."id" = ? [["id", 616453971]]
1466250
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 3012c733-0394-4129-826b-78eb09a87651) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1466251
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466252
+ SQL (0.1ms) UPDATE "stacks" SET "cached_deploy_spec" = ?, "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["cached_deploy_spec", "{\"machine\":{\"environment\":{}},\"review\":{\"checklist\":[\"foo\",\"bar\",\"baz\"],\"monitoring\":[{\"image\":\"https://example.com/monitor.png\",\"width\":200,\"height\":300}]},\"dependencies\":{\"override\":[]},\"deploy\":{\"override\":null,\"variables\":[{\"name\":\"SAFETY_DISABLED\",\"title\":\"Set to 1 to do dangerous things\",\"default\":0}]},\"rollback\":{\"override\":[\"echo 'Rollback!'\"]},\"fetch\":[\"echo '42'\"],\"tasks\":{\"restart\":{\"action\":\"Restart application\",\"description\":\"Restart app and job servers\",\"steps\":[\"cap $ENVIRONMENT deploy:restart\"]}},\"ci\":{\"hide\":[\"ci/hidden\"],\"allow_failures\":[\"ci/ok_to_fail\"]}}"], ["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:06.187733"], ["id", 616453971]]
1466253
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466254
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 843611b5-6fb4-45fb-ae31-de9e6bd38f47) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborted\",\"updated_at\":\"2015-12-04T14:58:06.177Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborted\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.187Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}}"}
1466255
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 31bbd068-7d3e-4824-a691-4b52841fe47c) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.187Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}}"}
1466256
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466257
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback') AND "tasks"."stack_id" = ? [["stack_id", 616453971]]
1466258
+ [Redis] command=FLUSHDB args=
1466259
+ [Redis] call_time=0.12 ms
1466260
+  (0.9ms) rollback transaction
1466261
+  (0.0ms) begin transaction
1466262
+ -----------------------------------------------------------
1466263
+ DeploysTest: test_entering_flapping_state_triggers_webhooks
1466264
+ -----------------------------------------------------------
1466265
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466266
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466267
+ [Redis] call_time=0.14 ms
1466268
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466269
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466270
+  (0.0ms) SAVEPOINT active_record_1
1466271
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "flapping"], ["updated_at", "2015-12-04 14:58:06.204467"], ["id", 616453971]]
1466272
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466273
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.206235' WHERE "stacks"."id" = ? [["id", 616453971]]
1466274
+ SQL (0.2ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -1], ["updated_at", "2015-12-04 14:58:06.208073"], ["id", 616453971]]
1466275
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.209107' WHERE "stacks"."id" = ? [["id", 616453971]]
1466276
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466277
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466278
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466279
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466280
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466281
+ [ActiveJob] Enqueued EmitEventJob (Job ID: b3314592-eebb-4f94-a1ba-b74d947256be) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"flapping\",\"updated_at\":\"2015-12-04T14:58:06.208Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"flapping\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.209Z\"}}"}
1466282
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466283
+ [Redis] command=FLUSHDB args=
1466284
+ [Redis] call_time=0.14 ms
1466285
+  (0.7ms) rollback transaction
1466286
+  (0.0ms) begin transaction
1466287
+ --------------------------------------------------------------------
1466288
+ DeploysTest: test_#reject!_bails_out_if_the_deploy_is_failed_already
1466289
+ --------------------------------------------------------------------
1466290
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466291
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466292
+ [Redis] call_time=0.14 ms
1466293
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466294
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466295
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 533999748]]
1466296
+ [Redis] command=FLUSHDB args=
1466297
+ [Redis] call_time=0.17 ms
1466298
+  (0.0ms) rollback transaction
1466299
+  (0.1ms) begin transaction
1466300
+ -------------------------------------------------
1466301
+ DeploysTest: test_abort!_transition_to_`aborting`
1466302
+ -------------------------------------------------
1466303
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466304
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466305
+ [Redis] call_time=0.13 ms
1466306
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466307
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466308
+ [Redis] command=GET args="task:616453971:pid"
1466309
+ [Redis] call_time=0.12 ms
1466310
+  (0.0ms) SAVEPOINT active_record_1
1466311
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466312
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466313
+  (0.0ms) SAVEPOINT active_record_1
1466314
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:06.227602"], ["id", 616453971]]
1466315
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.228831' WHERE "stacks"."id" = ? [["id", 616453971]]
1466316
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466317
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466318
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466319
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466320
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466321
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 6ba2dd4c-26de-44f3-bf47-5b67e1290a5a) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:06.227Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.228Z\"}}"}
1466322
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466323
+  (0.0ms) SAVEPOINT active_record_1
1466324
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:06.239127"], ["updated_at", "2015-12-04 14:58:06.239127"]]
1466325
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466326
+ [Redis] command=FLUSHDB args=
1466327
+ [Redis] call_time=0.18 ms
1466328
+  (0.6ms) rollback transaction
1466329
+  (0.0ms) begin transaction
1466330
+ ---------------------------------------------------------------------------
1466331
+ DeploysTest: test_transitioning_to_failed_causes_an_event_to_be_broadcasted
1466332
+ ---------------------------------------------------------------------------
1466333
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466334
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466335
+ [Redis] call_time=0.18 ms
1466336
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466337
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466338
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1466339
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466340
+  (0.0ms) SAVEPOINT active_record_1
1466341
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "failed"], ["updated_at", "2015-12-04 14:58:06.248378"], ["id", 496901070]]
1466342
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.249825' WHERE "stacks"."id" = ? [["id", 616453971]]
1466343
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 17fdc23a-92ae-4316-89b0-2a2f6d29f706) to Test(default) with arguments: gid://shipit/Stack/616453971
1466344
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466345
+ [Redis] command=FLUSHDB args=
1466346
+ [Redis] call_time=0.20 ms
1466347
+  (0.5ms) rollback transaction
1466348
+  (0.0ms) begin transaction
1466349
+ -----------------------------------------------------------
1466350
+ DeploysTest: test_#build_rollback_returns_an_unsaved_record
1466351
+ -----------------------------------------------------------
1466352
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466353
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466354
+ [Redis] call_time=0.22 ms
1466355
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466356
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466357
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466358
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466359
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466360
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466361
+ [Redis] command=FLUSHDB args=
1466362
+ [Redis] call_time=0.17 ms
1466363
+  (0.1ms) rollback transaction
1466364
+  (0.0ms) begin transaction
1466365
+ ----------------------------------------------------------------------------
1466366
+ DeploysTest: test_transitioning_to_success_causes_an_event_to_be_broadcasted
1466367
+ ----------------------------------------------------------------------------
1466368
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466369
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466370
+ [Redis] call_time=0.19 ms
1466371
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466372
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466373
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1466374
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466375
+  (0.1ms) SAVEPOINT active_record_1
1466376
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.267291"], ["id", 496901070]]
1466377
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.268623' WHERE "stacks"."id" = ? [["id", 616453971]]
1466378
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 8a8d24fa-6a9d-4a6f-9bf7-cbeeec0c1b02) to Test(default) with arguments: gid://shipit/Stack/616453971
1466379
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466380
+ SQL (0.3ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466381
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466382
+ [Redis] command=FLUSHDB args=
1466383
+ [Redis] call_time=0.19 ms
1466384
+  (0.7ms) rollback transaction
1466385
+  (0.0ms) begin transaction
1466386
+ --------------------------------------------------------------
1466387
+ DeploysTest: test_#commits_returns_commits_from_newer_to_older
1466388
+ --------------------------------------------------------------
1466389
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466390
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466391
+ [Redis] call_time=0.17 ms
1466392
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466393
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466394
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1466395
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466396
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466397
+  (0.2ms) SELECT "commits"."id" FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466398
+ [Redis] command=FLUSHDB args=
1466399
+ [Redis] call_time=0.23 ms
1466400
+  (0.1ms) rollback transaction
1466401
+  (0.1ms) begin transaction
1466402
+ -----------------------------------------------------------
1466403
+ DeploysTest: test_destroy_deletes_the_related_output_chunks
1466404
+ -----------------------------------------------------------
1466405
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466406
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466407
+ [Redis] call_time=0.15 ms
1466408
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466409
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466410
+  (0.1ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1466411
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1466412
+  (0.0ms) SAVEPOINT active_record_1
1466413
+ OutputChunk Load (0.1ms) SELECT "output_chunks".* FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1466414
+ SQL (0.3ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 28353825]]
1466415
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 414839965]]
1466416
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 533999748]]
1466417
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 616453971]]
1466418
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 684916759]]
1466419
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 918001080]]
1466420
+ SQL (0.1ms) DELETE FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."id" = ? [["id", 616453971]]
1466421
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466422
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) - 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466423
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.289080' WHERE "stacks"."id" = ? [["id", 616453971]]
1466424
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466425
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1466426
+ [Redis] command=FLUSHDB args=
1466427
+ [Redis] call_time=0.19 ms
1466428
+  (0.9ms) rollback transaction
1466429
+  (0.1ms) begin transaction
1466430
+ -------------------------------------------------------------------------------
1466431
+ DeploysTest: test_abort!_transition_to_`aborted`_if_the_process_is_already_dead
1466432
+ -------------------------------------------------------------------------------
1466433
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466434
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466435
+ [Redis] call_time=0.23 ms
1466436
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466437
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466438
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1466439
+ [Redis] command=SET args="task:644540443:pid" "42" "EX" 3600
1466440
+ [Redis] call_time=0.21 ms
1466441
+ [Redis] command=GET args="task:644540443:pid"
1466442
+ [Redis] call_time=0.19 ms
1466443
+  (0.0ms) SAVEPOINT active_record_1
1466444
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466445
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466446
+  (0.0ms) SAVEPOINT active_record_1
1466447
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:06.301391"], ["id", 644540443]]
1466448
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.302630' WHERE "stacks"."id" = ? [["id", 616453971]]
1466449
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466450
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466451
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466452
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466453
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466454
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 69807d42-7d76-4a4b-af87-31e808e298b9) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:06.301Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.302Z\"}}"}
1466455
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466456
+  (0.0ms) SAVEPOINT active_record_1
1466457
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:06.312297"], ["updated_at", "2015-12-04 14:58:06.312297"]]
1466458
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466459
+ [Redis] command=GET args="task:644540443:pid"
1466460
+ [Redis] call_time=0.15 ms
1466461
+ [Redis] command=GET args="task:644540443:pid"
1466462
+ [Redis] call_time=0.13 ms
1466463
+  (0.0ms) SAVEPOINT active_record_1
1466464
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466465
+  (0.0ms) SAVEPOINT active_record_1
1466466
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466467
+  (0.0ms) SAVEPOINT active_record_1
1466468
+ SQL (0.4ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:06.319379"], ["updated_at", "2015-12-04 14:58:06.319379"]]
1466469
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466470
+  (0.0ms) SAVEPOINT active_record_1
1466471
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: PID 42 ESRCH: No such process\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:06.321199"], ["updated_at", "2015-12-04 14:58:06.321199"]]
1466472
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466473
+  (0.0ms) SAVEPOINT active_record_1
1466474
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborted"], ["updated_at", "2015-12-04 14:58:06.323366"], ["id", 644540443]]
1466475
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.324810' WHERE "stacks"."id" = ? [["id", 616453971]]
1466476
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 55e11945-74c9-429c-b8ae-919815c8a739) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborted\",\"updated_at\":\"2015-12-04T14:58:06.323Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborted\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.324Z\"}}"}
1466477
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466478
+ [Redis] command=FLUSHDB args=
1466479
+ [Redis] call_time=0.12 ms
1466480
+  (0.8ms) rollback transaction
1466481
+  (0.1ms) begin transaction
1466482
+ ----------------------------------------------------------------------------
1466483
+ DeploysTest: test_#trigger_revert_rolls_the_stack_back_to_before_this_deploy
1466484
+ ----------------------------------------------------------------------------
1466485
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466486
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466487
+ [Redis] call_time=0.13 ms
1466488
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466489
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466490
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466491
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466492
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466493
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466494
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1466495
+  (0.0ms) SAVEPOINT active_record_1
1466496
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466497
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466498
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 2], ["until_commit_id", 1], ["created_at", "2015-12-04 14:58:06.339896"], ["updated_at", "2015-12-04 14:58:06.339896"], ["additions", 1], ["deletions", 1]]
1466499
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466500
+ SQL (0.5ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.343744' WHERE "stacks"."id" = ? [["id", 616453971]]
1466501
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466502
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: c058cdec-7ad6-4c40-bea0-86a15035da5f) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1466503
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466504
+  (0.1ms) SAVEPOINT active_record_1
1466505
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466506
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for f890fd8b5f2be05d1fedb763a3605ee461c39074 has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:06.350494"], ["id", 616453971]]
1466507
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466508
+ [ActiveJob] Enqueued EmitEventJob (Job ID: c1171a12-db2c-4590-bf5b-0475fe178eed) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for f890fd8b5f2be05d1fedb763a3605ee461c39074 has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.350Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}}"}
1466509
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466510
+  (0.1ms) SAVEPOINT active_record_1
1466511
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "running"], ["updated_at", "2015-12-04 14:58:06.357096"], ["id", 783434609]]
1466512
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.358527' WHERE "stacks"."id" = ? [["id", 616453971]]
1466513
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466514
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466515
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466516
+ [ActiveJob] Enqueued EmitEventJob (Job ID: f1b72406-b067-422f-81ff-ee9baf59d4fa) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"running\",\"updated_at\":\"2015-12-04T14:58:06.357Z\",\"created_at\":\"2015-12-04T14:58:06.339Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"6d9278037b872fd9a6690523e411ecb3aa181355\",\"message\":\"lets go\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"running\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.358Z\"}}"}
1466517
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466518
+  (0.1ms) SAVEPOINT active_record_1
1466519
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.369589"], ["id", 783434609]]
1466520
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.371076' WHERE "stacks"."id" = ? [["id", 616453971]]
1466521
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 4fd2c7ac-37ca-4ab0-ac74-17ffbbcbcade) to Test(default) with arguments: gid://shipit/Stack/616453971
1466522
+ SQL (0.2ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 1)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466523
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 72131862-ab0e-4f74-8660-526a3a3d061b) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:06.369Z\",\"created_at\":\"2015-12-04T14:58:06.339Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"6d9278037b872fd9a6690523e411ecb3aa181355\",\"message\":\"lets go\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.371Z\"}}"}
1466524
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466525
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1466526
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466527
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1466528
+ [Redis] command=FLUSHDB args=
1466529
+ [Redis] call_time=0.12 ms
1466530
+  (0.8ms) rollback transaction
1466531
+  (0.0ms) begin transaction
1466532
+ --------------------------------------------------------------------------
1466533
+ DeploysTest: test_#chunk_output_joins_all_chunk_test_if_logs_not_rolled_up
1466534
+ --------------------------------------------------------------------------
1466535
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466536
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466537
+ [Redis] call_time=0.14 ms
1466538
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466539
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466540
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1466541
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1466542
+  (0.0ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1466543
+  (0.1ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1466544
+ [Redis] command=FLUSHDB args=
1466545
+ [Redis] call_time=0.14 ms
1466546
+  (0.0ms) rollback transaction
1466547
+  (0.0ms) begin transaction
1466548
+ --------------------------------------------------------------------------
1466549
+ DeploysTest: test_transitioning_to_error_causes_an_event_to_be_broadcasted
1466550
+ --------------------------------------------------------------------------
1466551
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466552
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466553
+ [Redis] call_time=0.17 ms
1466554
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466555
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466556
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1466557
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466558
+  (0.0ms) SAVEPOINT active_record_1
1466559
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "error"], ["updated_at", "2015-12-04 14:58:06.401540"], ["id", 496901070]]
1466560
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.403087' WHERE "stacks"."id" = ? [["id", 616453971]]
1466561
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: accd2d71-cd7e-4ff9-9b40-b3620a7b6431) to Test(default) with arguments: gid://shipit/Stack/616453971
1466562
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466563
+ [Redis] command=FLUSHDB args=
1466564
+ [Redis] call_time=0.21 ms
1466565
+  (0.4ms) rollback transaction
1466566
+  (0.0ms) begin transaction
1466567
+ -----------------------------------------------------------------
1466568
+ DeploysTest: test_#commits_returns_empty_array_if_stack_isn't_set
1466569
+ -----------------------------------------------------------------
1466570
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466571
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466572
+ [Redis] call_time=0.14 ms
1466573
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466574
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466575
+ [Redis] command=FLUSHDB args=
1466576
+ [Redis] call_time=0.13 ms
1466577
+  (0.0ms) rollback transaction
1466578
+  (0.0ms) begin transaction
1466579
+ -------------------------------------------------------------------------------------------------
1466580
+ DeploysTest: test_transitioning_to_success_skips_CD_when_no_successful_commits_after_until_commit
1466581
+ -------------------------------------------------------------------------------------------------
1466582
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466583
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466584
+ [Redis] call_time=0.15 ms
1466585
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466586
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466587
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1466588
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466589
+  (0.1ms) SAVEPOINT active_record_1
1466590
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466591
+ SQL (0.3ms) UPDATE "stacks" SET "continuous_deployment" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["continuous_deployment", "t"], ["updated_at", "2015-12-04 14:58:06.414092"], ["id", 616453971]]
1466592
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466593
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1466594
+  (0.0ms) SAVEPOINT active_record_1
1466595
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.417731"], ["id", 644540443]]
1466596
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.418826' WHERE "stacks"."id" = ? [["id", 616453971]]
1466597
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: e5a85ac1-a0b2-4793-84ef-bf0f66bd7166) to Test(default) with arguments: gid://shipit/Stack/616453971
1466598
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466599
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND (id > 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466600
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" IN (5) ORDER BY "statuses"."created_at" DESC
1466601
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466602
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466603
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466604
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466605
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466606
+ [ActiveJob] Enqueued EmitEventJob (Job ID: f702593c-a0bd-4202-b1f2-2029b843c21d) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:06.417Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":true,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.418Z\"}}"}
1466607
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466608
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1466609
+ [Redis] command=FLUSHDB args=
1466610
+ [Redis] call_time=0.17 ms
1466611
+  (0.9ms) rollback transaction
1466612
+  (0.1ms) begin transaction
1466613
+ ----------------------------------------------------------------------------------
1466614
+ DeploysTest: test_transitioning_to_error_schedule_a_fetch_of_the_deployed_revision
1466615
+ ----------------------------------------------------------------------------------
1466616
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466617
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466618
+ [Redis] call_time=0.17 ms
1466619
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466620
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466621
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1466622
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466623
+  (0.0ms) SAVEPOINT active_record_1
1466624
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "error"], ["updated_at", "2015-12-04 14:58:06.445078"], ["id", 644540443]]
1466625
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.446828' WHERE "stacks"."id" = ? [["id", 616453971]]
1466626
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: b63acd81-6a47-4455-af53-7bf84670f7f4) to Test(default) with arguments: gid://shipit/Stack/616453971
1466627
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466628
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466629
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466630
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466631
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466632
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d00b1501-3be1-4280-9f88-677be2163271) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"error\",\"updated_at\":\"2015-12-04T14:58:06.445Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"error\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.446Z\"}}"}
1466633
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466634
+ [Redis] command=FLUSHDB args=
1466635
+ [Redis] call_time=0.13 ms
1466636
+  (0.5ms) rollback transaction
1466637
+  (0.0ms) begin transaction
1466638
+ ----------------------------------------------------------
1466639
+ DeploysTest: test_#trigger_rollback_creates_a_new_Rollback
1466640
+ ----------------------------------------------------------
1466641
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466642
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466643
+ [Redis] call_time=0.17 ms
1466644
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466645
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466646
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback')
1466647
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466648
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466649
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466650
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466651
+  (0.0ms) SAVEPOINT active_record_1
1466652
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466653
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466654
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:06.464038"], ["updated_at", "2015-12-04 14:58:06.464038"], ["additions", 432], ["deletions", 406]]
1466655
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466656
+ SQL (0.4ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.467229' WHERE "stacks"."id" = ? [["id", 616453971]]
1466657
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466658
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 3c14e65c-09a2-498a-ada2-de7c938b779c) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1466659
+  (0.0ms) SAVEPOINT active_record_1
1466660
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466661
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:06.472327"], ["id", 616453971]]
1466662
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466663
+ [ActiveJob] Enqueued EmitEventJob (Job ID: cc1d6b16-63cc-4a7d-ba0b-483255cb5046) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.472Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}}"}
1466664
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466665
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback')
1466666
+ [Redis] command=FLUSHDB args=
1466667
+ [Redis] call_time=0.17 ms
1466668
+  (0.8ms) rollback transaction
1466669
+  (0.0ms) begin transaction
1466670
+ -----------------------------------------------------------------------------
1466671
+ DeploysTest: test_#since_commit_id_returns_a_default_value_if_stack_id_is_set
1466672
+ -----------------------------------------------------------------------------
1466673
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466674
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466675
+ [Redis] call_time=0.22 ms
1466676
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466677
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466678
+ Deploy Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."stack_id" = ? AND "tasks"."status" = ? ORDER BY "tasks"."id" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466679
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466680
+ Deploy Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."stack_id" = ? AND "tasks"."status" = ? ORDER BY "tasks"."id" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466681
+ [Redis] command=FLUSHDB args=
1466682
+ [Redis] call_time=0.34 ms
1466683
+  (0.0ms) rollback transaction
1466684
+  (0.0ms) begin transaction
1466685
+ --------------------------------------------------------------------
1466686
+ DeploysTest: test_#since_commit_id_returns_nil_if_stack_id_isn't_set
1466687
+ --------------------------------------------------------------------
1466688
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466689
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466690
+ [Redis] call_time=0.17 ms
1466691
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466692
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466693
+ [Redis] command=FLUSHDB args=
1466694
+ [Redis] call_time=0.20 ms
1466695
+  (0.1ms) rollback transaction
1466696
+  (0.0ms) begin transaction
1466697
+ ------------------------------------------
1466698
+ DeploysTest: test_#rollback?_returns_false
1466699
+ ------------------------------------------
1466700
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466701
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466702
+ [Redis] call_time=0.13 ms
1466703
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466704
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466705
+ [Redis] command=FLUSHDB args=
1466706
+ [Redis] call_time=0.17 ms
1466707
+  (0.0ms) rollback transaction
1466708
+  (0.0ms) begin transaction
1466709
+ -------------------------------------------------------------------------------------------
1466710
+ DeploysTest: test_#build_rollback_set_the_last_deployed_commit_as_the_rollback_since_commit
1466711
+ -------------------------------------------------------------------------------------------
1466712
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466713
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466714
+ [Redis] call_time=0.14 ms
1466715
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466716
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466717
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466718
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466719
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466720
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466721
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466722
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466723
+ [Redis] command=FLUSHDB args=
1466724
+ [Redis] call_time=0.16 ms
1466725
+  (0.1ms) rollback transaction
1466726
+  (0.0ms) begin transaction
1466727
+ ---------------------------------------------------------------------------------
1466728
+ DeploysTest: test_abort!_schedule_the_rollback_if_`rollback_once_aborted`_is_true
1466729
+ ---------------------------------------------------------------------------------
1466730
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466731
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466732
+ [Redis] call_time=0.13 ms
1466733
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466734
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466735
+ [Redis] command=GET args="task:616453971:pid"
1466736
+ [Redis] call_time=0.17 ms
1466737
+  (0.0ms) SAVEPOINT active_record_1
1466738
+ SQL (0.2ms) UPDATE "tasks" SET "rollback_once_aborted" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["rollback_once_aborted", "t"], ["updated_at", "2015-12-04 14:58:06.501670"], ["id", 616453971]]
1466739
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466740
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.503391' WHERE "stacks"."id" = ? [["id", 616453971]]
1466741
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466742
+  (0.0ms) SAVEPOINT active_record_1
1466743
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:06.506365"], ["id", 616453971]]
1466744
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.507605' WHERE "stacks"."id" = ? [["id", 616453971]]
1466745
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466746
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466747
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466748
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466749
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466750
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 8d7248d7-ddd7-42a7-8ee1-5e095da6eb74) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:06.506Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.507Z\"}}"}
1466751
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466752
+  (0.0ms) SAVEPOINT active_record_1
1466753
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:06.517651"], ["updated_at", "2015-12-04 14:58:06.517651"]]
1466754
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466755
+ Deploy Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466756
+ [Redis] command=FLUSHDB args=
1466757
+ [Redis] call_time=0.14 ms
1466758
+  (0.9ms) rollback transaction
1466759
+  (0.0ms) begin transaction
1466760
+ ----------------------------------------------------------------------------------
1466761
+ DeploysTest: test_transitioning_to_success_triggers_next_deploy_when_stack_uses_CD
1466762
+ ----------------------------------------------------------------------------------
1466763
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466764
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466765
+ [Redis] call_time=0.20 ms
1466766
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466767
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466768
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1466769
+  (0.0ms) SAVEPOINT active_record_1
1466770
+ SQL (0.2ms) INSERT INTO "statuses" ("state", "commit_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["state", "success"], ["commit_id", 5], ["created_at", "2015-12-04 14:58:06.524906"], ["updated_at", "2015-12-04 14:58:06.524906"]]
1466771
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1466772
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466773
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:06.527404' WHERE "commits"."id" = ? [["id", 5]]
1466774
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.528121' WHERE "stacks"."id" = ? [["id", 616453971]]
1466775
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.528717' WHERE "stacks"."id" = ? [["id", 616453971]]
1466776
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:06.529564' WHERE "commits"."id" = ? [["id", 5]]
1466777
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.530150' WHERE "stacks"."id" = ? [["id", 616453971]]
1466778
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.531442' WHERE "stacks"."id" = ? [["id", 616453971]]
1466779
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" = ? ORDER BY "statuses"."created_at" DESC [["commit_id", 5]]
1466780
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466781
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1466782
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466783
+  (0.0ms) SAVEPOINT active_record_1
1466784
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1466785
+ SQL (0.1ms) UPDATE "stacks" SET "continuous_deployment" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["continuous_deployment", "t"], ["updated_at", "2015-12-04 14:58:06.538525"], ["id", 616453971]]
1466786
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466787
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1466788
+  (0.0ms) SAVEPOINT active_record_1
1466789
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.541757"], ["id", 644540443]]
1466790
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.543034' WHERE "stacks"."id" = ? [["id", 616453971]]
1466791
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 8ebecc38-3e10-4d0d-bdcd-99c35f9adeb8) to Test(default) with arguments: gid://shipit/Stack/616453971
1466792
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466793
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND (id > 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1466794
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" IN (5) ORDER BY "statuses"."created_at" DESC
1466795
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466796
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1466797
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466798
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466799
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 4) AND (id <= 5) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466800
+ SQL (0.2ms) INSERT INTO "tasks" ("type", "user_id", "until_commit_id", "since_commit_id", "stack_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Deploy"], ["user_id", 1047960473], ["until_commit_id", 5], ["since_commit_id", 4], ["stack_id", 616453971], ["created_at", "2015-12-04 14:58:06.550070"], ["updated_at", "2015-12-04 14:58:06.550070"], ["additions", 1], ["deletions", 24]]
1466801
+ SQL (0.0ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1466802
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.553133' WHERE "stacks"."id" = ? [["id", 616453971]]
1466803
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 9483cc9b-50a0-4c41-9d11-e8c39199d08c) to Test(deploys) with arguments: gid://shipit/Deploy/783434609
1466804
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466805
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466806
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466807
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466808
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466809
+ [ActiveJob] Enqueued EmitEventJob (Job ID: e48b9dc6-343a-4024-9d50-8acc7b7e75b9) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:06.541Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":true,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.543Z\"}}"}
1466810
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466811
+  (0.2ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1466812
+ [Redis] command=FLUSHDB args=
1466813
+ [Redis] call_time=0.17 ms
1466814
+  (0.9ms) rollback transaction
1466815
+  (0.1ms) begin transaction
1466816
+ --------------------------------------------------------------
1466817
+ DeploysTest: test_#commits_returns_the_commits_in_the_id_range
1466818
+ --------------------------------------------------------------
1466819
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466820
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466821
+ [Redis] call_time=0.15 ms
1466822
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466823
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466824
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1466825
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1466826
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466827
+  (0.1ms) SELECT COUNT(*) FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 3) [["stack_id", 616453971]]
1466828
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 3) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466829
+ [Redis] command=FLUSHDB args=
1466830
+ [Redis] call_time=0.14 ms
1466831
+  (0.0ms) rollback transaction
1466832
+  (0.0ms) begin transaction
1466833
+ ------------------------------------------------------------------------------------
1466834
+ DeploysTest: test_transitioning_to_success_schedule_a_fetch_of_the_deployed_revision
1466835
+ ------------------------------------------------------------------------------------
1466836
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466837
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466838
+ [Redis] call_time=0.33 ms
1466839
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466840
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466841
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1466842
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466843
+  (0.1ms) SAVEPOINT active_record_1
1466844
+ SQL (0.4ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:06.579911"], ["id", 644540443]]
1466845
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.581900' WHERE "stacks"."id" = ? [["id", 616453971]]
1466846
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 6f1502bd-f108-4310-a355-3f410937be2f) to Test(default) with arguments: gid://shipit/Stack/616453971
1466847
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1466848
+ SQL (0.4ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1466849
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466850
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466851
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466852
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466853
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 994d8e32-9a56-4639-9273-15f80ecb61ac) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:06.579Z\",\"created_at\":\"2015-12-04T14:03:05.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:05.000Z\",\"committed_at\":\"2015-12-01T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.581Z\"}}"}
1466854
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466855
+ [Redis] command=FLUSHDB args=
1466856
+ [Redis] call_time=0.18 ms
1466857
+  (0.7ms) rollback transaction
1466858
+  (0.0ms) begin transaction
1466859
+ ------------------------------------------------------------
1466860
+ DeploysTest: test_abort!_sends_a_SIGTERM_to_the_recorded_PID
1466861
+ ------------------------------------------------------------
1466862
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1466863
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1466864
+ [Redis] call_time=0.15 ms
1466865
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466866
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466867
+ [Redis] command=GET args="task:616453971:pid"
1466868
+ [Redis] call_time=0.12 ms
1466869
+ [Redis] command=GET args="task:616453971:pid"
1466870
+ [Redis] call_time=0.13 ms
1466871
+  (0.1ms) SAVEPOINT active_record_1
1466872
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1466873
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466874
+  (0.0ms) SAVEPOINT active_record_1
1466875
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:06.604543"], ["id", 616453971]]
1466876
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:06.605931' WHERE "stacks"."id" = ? [["id", 616453971]]
1466877
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466878
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1466879
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1466880
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466881
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1466882
+ [ActiveJob] Enqueued EmitEventJob (Job ID: a3b911b2-13cf-44c2-a5fb-e050979ddb87) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:06.604Z\",\"created_at\":\"2015-12-04T13:59:05.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:05.000Z\",\"committed_at\":\"2015-11-27T14:58:05.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:05.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:05.000Z\",\"updated_at\":\"2015-12-04T14:58:06.605Z\"}}"}
1466883
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1466884
+  (0.0ms) SAVEPOINT active_record_1
1466885
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:06.615615"], ["updated_at", "2015-12-04 14:58:06.615615"]]
1466886
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1466887
+ [Redis] command=FLUSHDB args=
1466888
+ [Redis] call_time=0.18 ms
1466889
+  (0.5ms) rollback transaction
1466890
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1466891
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
1466892
+  (0.1ms) begin transaction
1466893
+ Fixture Delete (0.3ms) DELETE FROM "api_clients"
1466894
+ Fixture Insert (0.3ms) INSERT INTO "api_clients" ("name", "permissions", "created_at", "updated_at", "id", "creator_id") VALUES ('Spy', '---
1466895
+ - read:stack
1466896
+ - write:stack
1466897
+ - deploy:stack
1466898
+ - lock:stack
1466899
+ - read:hook
1466900
+ - write:hook
1466901
+ ', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 789626743, 1047960473)
1466902
+ Fixture Insert (0.1ms) INSERT INTO "api_clients" ("name", "permissions", "created_at", "updated_at", "id", "creator_id", "stack_id") VALUES ('Here Come The Walrus', '---
1466903
+ - read:stack
1466904
+ ', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 605148871, 1047960473, 616453971)
1466905
+ Fixture Delete (0.1ms) DELETE FROM "commits"
1466906
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (1, '6d9278037b872fd9a6690523e411ecb3aa181355', 'lets go', '2015-11-24 14:58:40.000000', '2015-11-25 14:58:40.000000', 42, 24, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 616453971, 1047960473, 1047960473)
1466907
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (2, 'f890fd8b5f2be05d1fedb763a3605ee461c39074', 'sheep it!', '2015-11-26 14:58:40.000000', '2015-11-27 14:58:40.000000', 1, 1, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 616453971, 1047960473, 1047960473)
1466908
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (3, '367578b362bf2b4df5903e1c7960929361c39074', 'fix it!', '2015-11-28 14:58:40.000000', '2015-11-29 14:58:40.000000', 12, 64, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 616453971, 1047960473, 1047960473)
1466909
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (4, '467578b362bf2b4df5903e1c7960929361c3435a', '#yoloshipit!', '2015-11-30 14:58:40.000000', '2015-12-01 14:58:40.000000', 420, 342, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 616453971, 1047960473, 1047960473)
1466910
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (5, '567578b362bf2b4df5903e1c7960929361c3abcd', 'fix all teh things', '2015-12-02 14:58:40.000000', '2015-12-03 14:58:40.000000', 1, 24, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 616453971, 1047960473, 1047960473)
1466911
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (6, '8e859b4c19ea7638443d43d612086948bce51701', 'Chips!', '2015-12-02 14:58:40.000000', '2015-12-03 14:58:40.000000', 1, 24, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 805262699, 902541635, 902541635)
1466912
+ Fixture Insert (0.1ms) INSERT INTO "commits" ("id", "sha", "message", "authored_at", "committed_at", "additions", "deletions", "updated_at", "created_at", "stack_id", "author_id", "committer_id") VALUES (7, '44b3833d39def7ec65b57b42f496eb27ab4980b6', 'Cake!', '2015-12-02 14:58:40.000000', '2015-12-03 14:58:40.000000', 1, 24, '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 1068256954, 902541635, 902541635)
1466913
+ Fixture Delete (0.1ms) DELETE FROM "deliveries"
1466914
+ Fixture Insert (0.1ms) INSERT INTO "deliveries" ("event", "status", "url", "content_type", "payload", "created_at", "updated_at", "id", "hook_id") VALUES ('deploy', 'scheduled', 'https://example.com/events/deploy', 'application/json', '{
1466915
+ "stack": {
1466916
+ },
1466917
+ "deploy": {
1466918
+ }
1466919
+ }', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 312741596, 264212040)
1466920
+ Fixture Delete (0.1ms) DELETE FROM "github_hooks"
1466921
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("event", "secret", "github_id", "type", "created_at", "updated_at", "id", "stack_id") VALUES ('push', '1234', 42, 'GithubHook::Repo', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 407351417, 616453971)
1466922
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("event", "secret", "github_id", "type", "created_at", "updated_at", "id", "stack_id") VALUES ('status', '1234', 43, 'GithubHook::Repo', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 1010930799, 616453971)
1466923
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("event", "secret", "type", "created_at", "updated_at", "id", "stack_id") VALUES ('push', '1234', 'GithubHook::Repo', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 1038686235, 805262699)
1466924
+ Fixture Insert (0.1ms) INSERT INTO "github_hooks" ("organization", "event", "secret", "type", "created_at", "updated_at", "id") VALUES ('shopify', 'membership', '1234', 'GithubHook::Organization', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 465236859)
1466925
+ Fixture Delete (0.1ms) DELETE FROM "hooks"
1466926
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('deploy,rollback', 'https://example.com/events/deploy', 'json', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 264212040, 616453971)
1466927
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id") VALUES ('deploy,rollback', 'https://example.com/events/deploy', 'form', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 483377026)
1466928
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('task', 'https://example.com/events/deploy', 'json', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 593914235, 616453971)
1466929
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('commit_status', 'https://example.com/events/commit_status', 'json', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 1045017498, 616453971)
1466930
+ Fixture Insert (0.1ms) INSERT INTO "hooks" ("events", "url", "content_type", "created_at", "updated_at", "id", "stack_id") VALUES ('deploy_status', 'https://example.com/events/deploy_status', 'json', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 642664896, 805262699)
1466931
+ Fixture Delete (0.2ms) DELETE FROM "memberships"
1466932
+ Fixture Insert (0.1ms) INSERT INTO "memberships" ("team_id", "created_at", "updated_at", "id", "user_id") VALUES (1, '2015-12-04 14:58:40', '2015-12-04 14:58:40', 111652552, 1047960473)
1466933
+ Fixture Delete (0.1ms) DELETE FROM "output_chunks"
1466934
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('deploy deploy deploy, faiiil', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 616453971, 616453971)
1466935
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Migrating some stuff', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 533999748, 616453971)
1466936
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Compiling all the sass', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 684916759, 616453971)
1466937
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Making ops cry', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 918001080, 616453971)
1466938
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo rm -rf /', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 28353825, 616453971)
1466939
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo chmod -R 777 /', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 414839965, 616453971)
1466940
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Migrating some stuff', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 644540443, 644540443)
1466941
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Compiling all the sass', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 1045986342, 644540443)
1466942
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('Making ops cry', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 540862857, 644540443)
1466943
+ Fixture Insert (0.0ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo rm -rf /', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 389798162, 644540443)
1466944
+ Fixture Insert (0.1ms) INSERT INTO "output_chunks" ("text", "created_at", "updated_at", "id", "task_id") VALUES ('sudo chmod -R 777 /', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 238192810, 644540443)
1466945
+ Fixture Delete (0.1ms) DELETE FROM "stacks"
1466946
+ Fixture Insert (0.1ms) INSERT INTO "stacks" ("repo_owner", "repo_name", "environment", "branch", "ignore_ci", "tasks_count", "undeployed_commits_count", "cached_deploy_spec", "updated_at", "created_at", "id") VALUES ('shopify', 'shipit-engine', 'production', 'master', 't', 3, 1, '{
1466947
+ "machine": {"environment": {}},
1466948
+ "review": {
1466949
+ "checklist": ["foo", "bar", "baz"],
1466950
+ "monitoring": [
1466951
+ {"image": "https://example.com/monitor.png", "width": 200, "height": 300}
1466952
+ ]
1466953
+ },
1466954
+ "dependencies": {"override": []},
1466955
+ "deploy": {"override": null, "variables": [{"name": "SAFETY_DISABLED", "title": "Set to 1 to do dangerous things", "default": 0}]},
1466956
+ "rollback": {"override": ["echo ''Rollback!''"]},
1466957
+ "fetch": ["echo ''42''"],
1466958
+ "tasks": {
1466959
+ "restart": {
1466960
+ "action": "Restart application",
1466961
+ "description": "Restart app and job servers",
1466962
+ "steps": [
1466963
+ "cap $ENVIRONMENT deploy:restart"
1466964
+ ]
1466965
+ }
1466966
+ },
1466967
+ "ci": {
1466968
+ "hide": ["ci/hidden"],
1466969
+ "allow_failures": ["ci/ok_to_fail"]
1466970
+ }
1466971
+ }
1466972
+ ', '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 616453971)
1466973
+ Fixture Insert (0.1ms) INSERT INTO "stacks" ("repo_owner", "repo_name", "environment", "branch", "ignore_ci", "tasks_count", "undeployed_commits_count", "cached_deploy_spec", "updated_at", "created_at", "id") VALUES ('george', 'cyclimse', 'production', 'master', 'f', 0, 1, '{
1466974
+ "machine": {"environment": {}},
1466975
+ "review": {
1466976
+ "checklist": ["foo", "bar", "baz"],
1466977
+ "monitoring": [
1466978
+ {"image": "https://example.com/monitor.png", "width": 200, "height": 300}
1466979
+ ]
1466980
+ },
1466981
+ "dependencies": {"override": []},
1466982
+ "deploy": {"override": null},
1466983
+ "rollback": {"override": ["echo ''Rollback!''"]},
1466984
+ "fetch": ["echo ''42''"],
1466985
+ "tasks": {
1466986
+ "restart": {
1466987
+ "action": "Restart application",
1466988
+ "description": "Restart app and job servers",
1466989
+ "steps": [
1466990
+ "cap $ENVIRONMENT deploy:restart"
1466991
+ ]
1466992
+ }
1466993
+ }
1466994
+ }
1466995
+ ', '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 805262699)
1466996
+ Fixture Insert (0.1ms) INSERT INTO "stacks" ("repo_owner", "repo_name", "environment", "branch", "ignore_ci", "tasks_count", "undeployed_commits_count", "cached_deploy_spec", "updated_at", "created_at", "id") VALUES ('shopify', 'foo-bar', 'production', 'master', 't', 0, 1, '{
1466997
+ "machine": {"environment": {}},
1466998
+ "review": {
1466999
+ "checklist": ["foo", "bar", "baz"],
1467000
+ "monitoring": [
1467001
+ {"image": "https://example.com/monitor.png", "width": 200, "height": 300}
1467002
+ ]
1467003
+ },
1467004
+ "dependencies": {"override": []},
1467005
+ "deploy": {"override": null},
1467006
+ "rollback": {"override": ["echo ''Rollback!''"]},
1467007
+ "fetch": ["echo ''42''"],
1467008
+ "tasks": {
1467009
+ "restart": {
1467010
+ "action": "Restart application",
1467011
+ "description": "Restart app and job servers",
1467012
+ "steps": [
1467013
+ "cap $ENVIRONMENT deploy:restart"
1467014
+ ]
1467015
+ }
1467016
+ },
1467017
+ "ci": {
1467018
+ "hide": ["ci/hidden"],
1467019
+ "allow_failures": ["ci/ok_to_fail"]
1467020
+ }
1467021
+ }
1467022
+ ', '2015-11-26 14:58:40.000000', '2015-12-04 14:58:40', 1068256954)
1467023
+ Fixture Delete (0.1ms) DELETE FROM "statuses"
1467024
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (1, 'lets go', 'ci/travis', '2015-11-24 14:58:40.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:40', 123278920)
1467025
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'ci/travis', '2015-11-24 14:58:40.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:40', 434006389)
1467026
+ Fixture Insert (0.0ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'metrics/coveralls', '2015-11-24 14:58:40.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:40', 480414295)
1467027
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'ci/travis', '2015-11-25 14:58:40.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:40', 426673251)
1467028
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (2, 'lets go', 'metrics/coveralls', '2015-11-25 14:58:40.000000', 'failure', 'http://www.example.com', '2015-12-04 14:58:40', 795737880)
1467029
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (3, 'lets go', 'ci/travis', '2015-11-25 14:58:40.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:40', 655320231)
1467030
+ Fixture Insert (0.0ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (3, 'lets go', 'metrics/coveralls', '2015-11-25 14:58:40.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:40', 387423564)
1467031
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (4, 'lets go', 'ci/travis', '2015-11-25 14:58:40.000000', 'pending', 'http://www.example.com', '2015-12-04 14:58:40', 432368261)
1467032
+ Fixture Insert (0.0ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (4, 'lets go', 'metrics/coveralls', '2015-11-25 14:58:40.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:40', 867194541)
1467033
+ Fixture Insert (0.1ms) INSERT INTO "statuses" ("commit_id", "description", "context", "created_at", "state", "target_url", "updated_at", "id") VALUES (6, 'lets go', 'ci/travis', '2015-11-25 14:58:40.000000', 'success', 'http://www.example.com', '2015-12-04 14:58:40', 1045681328)
1467034
+ Fixture Delete (0.1ms) DELETE FROM "tasks"
1467035
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (1, 2, 'Deploy', 'success', 1, 1, '2015-12-04 13:59:40.000000', '2015-12-04 14:58:40', 616453971, 1047960473, 616453971)
1467036
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (2, 3, 'Deploy', 'failed', 12, 64, '2015-12-04 14:00:40.000000', '2015-12-04 14:58:40', 533999748, 1047960473, 616453971)
1467037
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "definition", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (2, 2, 'Task', 'success', '{
1467038
+ "id": "restart",
1467039
+ "action": "Restart application",
1467040
+ "description": "Restart app and job servers",
1467041
+ "steps": [
1467042
+ "cap $ENVIRONMENT deploy:restart"
1467043
+ ]
1467044
+ }
1467045
+ ', '2015-12-04 14:01:40.000000', '2015-12-04 14:58:40', 783434608, 1047960473, 616453971)
1467046
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "stack_id") VALUES (2, 4, 'Deploy', 'pending', 432, 406, '2015-12-04 14:02:40.000000', '2015-12-04 14:58:40', 496901070, 616453971)
1467047
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (3, 4, 'Deploy', 'running', 420, 342, '2015-12-04 14:03:40.000000', '2015-12-04 14:58:40', 644540443, 1047960473, 616453971)
1467048
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (3, 4, 'Deploy', 'success', 420, 342, '2015-12-04 14:04:40.000000', '2015-12-04 14:58:40', 214925279, 902541635, 616453971)
1467049
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "rollback_once_aborted", "created_at", "updated_at", "id", "user_id", "stack_id") VALUES (3, 4, 'Deploy', 'aborted', 420, 342, 't', '2015-12-04 14:05:40.000000', '2015-12-04 14:58:40', 656614832, 902541635, 616453971)
1467050
+ Fixture Insert (0.1ms) INSERT INTO "tasks" ("since_commit_id", "until_commit_id", "type", "status", "additions", "deletions", "created_at", "updated_at", "id", "user_id", "stack_id", "parent_id") VALUES (3, 4, 'Rollback', 'aborted', 420, 342, '2015-12-04 14:06:40.000000', '2015-12-04 14:58:40', 394236209, 902541635, 616453971, 656614832)
1467051
+ Fixture Delete (0.1ms) DELETE FROM "teams"
1467052
+ Fixture Insert (0.1ms) INSERT INTO "teams" ("id", "github_id", "organization", "slug", "name", "api_url", "created_at", "updated_at") VALUES (1, 1, 'shopify', 'developers', 'Developers', 'https://example.com/shopify/developers', '2015-12-04 14:58:40', '2015-12-04 14:58:40')
1467053
+ Fixture Insert (0.1ms) INSERT INTO "teams" ("id", "github_id", "organization", "slug", "name", "api_url", "created_at", "updated_at") VALUES (2, 2, 'cyclimse', 'cooks', 'Cooks', 'https://example.com/cyclimse/cooks', '2015-12-04 14:58:40', '2015-12-04 14:58:40')
1467054
+ Fixture Delete (0.1ms) DELETE FROM "users"
1467055
+ Fixture Insert (0.1ms) INSERT INTO "users" ("name", "email", "login", "created_at", "updated_at", "id") VALUES ('Lando Walrussian', 'walrus@shopify.com', 'walrus', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 1047960473)
1467056
+ Fixture Insert (0.1ms) INSERT INTO "users" ("name", "email", "github_id", "login", "created_at", "updated_at", "id") VALUES ('Bob the Builder', 'bob@bob.com', 1234, 'bob', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 902541635)
1467057
+ Fixture Insert (0.0ms) INSERT INTO "users" ("name", "email", "created_at", "updated_at", "id") VALUES ('Anonymous Legion', 'anonymous@example.com', '2015-12-04 14:58:40', '2015-12-04 14:58:40', 36826545)
1467058
+  (7.6ms) commit transaction
1467059
+  (0.1ms) begin transaction
1467060
+ ----------------------------------------------------------------------------
1467061
+ DeploysTest: test_#trigger_revert_rolls_the_stack_back_to_before_this_deploy
1467062
+ ----------------------------------------------------------------------------
1467063
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467064
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467065
+ [Redis] command=SELECT args=7
1467066
+ [Redis] call_time=0.18 ms
1467067
+ [Redis] call_time=0.73 ms
1467068
+ Stack Load (0.2ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467069
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467070
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467071
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467072
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467073
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467074
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1467075
+  (0.1ms) SAVEPOINT active_record_1
1467076
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467077
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1467078
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 2], ["until_commit_id", 1], ["created_at", "2015-12-04 14:58:40.558477"], ["updated_at", "2015-12-04 14:58:40.558477"], ["additions", 1], ["deletions", 1]]
1467079
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1467080
+ SQL (1.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.564325' WHERE "stacks"."id" = ? [["id", 616453971]]
1467081
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467082
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: dbf41488-16cf-4384-929d-76d2f7e3035d) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1467083
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467084
+  (0.1ms) SAVEPOINT active_record_1
1467085
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1467086
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for f890fd8b5f2be05d1fedb763a3605ee461c39074 has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:40.576899"], ["id", 616453971]]
1467087
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467088
+ [ActiveJob] Enqueued EmitEventJob (Job ID: ed57e6f2-1e22-48da-800a-9e153e70f27c) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for f890fd8b5f2be05d1fedb763a3605ee461c39074 has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.576Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}}"}
1467089
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467090
+  (0.0ms) SAVEPOINT active_record_1
1467091
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "running"], ["updated_at", "2015-12-04 14:58:40.583516"], ["id", 783434609]]
1467092
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.584684' WHERE "stacks"."id" = ? [["id", 616453971]]
1467093
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467094
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467095
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467096
+ [ActiveJob] Enqueued EmitEventJob (Job ID: f33e68fb-1714-47ff-9df3-52807f318137) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"running\",\"updated_at\":\"2015-12-04T14:58:40.583Z\",\"created_at\":\"2015-12-04T14:58:40.558Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"6d9278037b872fd9a6690523e411ecb3aa181355\",\"message\":\"lets go\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"running\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.584Z\"}}"}
1467097
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467098
+  (0.1ms) SAVEPOINT active_record_1
1467099
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:40.597618"], ["id", 783434609]]
1467100
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.599122' WHERE "stacks"."id" = ? [["id", 616453971]]
1467101
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: ebd8585b-c140-481c-adb1-3ad24c7703c8) to Test(default) with arguments: gid://shipit/Stack/616453971
1467102
+ SQL (0.2ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 1)) WHERE "stacks"."id" = ? [["id", 616453971]]
1467103
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 49da3b42-aafd-405c-9c0e-59acde52794e) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:40.597Z\",\"created_at\":\"2015-12-04T14:58:40.558Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"6d9278037b872fd9a6690523e411ecb3aa181355\",\"message\":\"lets go\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.599Z\"}}"}
1467104
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467105
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1467106
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467107
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1467108
+ [Redis] command=FLUSHDB args=
1467109
+ [Redis] call_time=0.13 ms
1467110
+  (0.8ms) rollback transaction
1467111
+  (0.0ms) begin transaction
1467112
+ --------------------------------------------------------------------------
1467113
+ DeploysTest: test_transitioning_to_error_causes_an_event_to_be_broadcasted
1467114
+ --------------------------------------------------------------------------
1467115
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467116
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467117
+ [Redis] call_time=0.17 ms
1467118
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467119
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467120
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1467121
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467122
+  (0.0ms) SAVEPOINT active_record_1
1467123
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "error"], ["updated_at", "2015-12-04 14:58:40.616112"], ["id", 496901070]]
1467124
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.617472' WHERE "stacks"."id" = ? [["id", 616453971]]
1467125
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: c98aef7f-c4a4-4e9d-bc6c-a33f176491d2) to Test(default) with arguments: gid://shipit/Stack/616453971
1467126
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467127
+ [Redis] command=FLUSHDB args=
1467128
+ [Redis] call_time=0.25 ms
1467129
+  (0.5ms) rollback transaction
1467130
+  (0.0ms) begin transaction
1467131
+ ------------------------------------------------------------
1467132
+ DeploysTest: test_abort!_sends_a_SIGTERM_to_the_recorded_PID
1467133
+ ------------------------------------------------------------
1467134
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467135
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467136
+ [Redis] call_time=0.16 ms
1467137
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467138
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467139
+ [Redis] command=GET args="task:616453971:pid"
1467140
+ [Redis] call_time=0.12 ms
1467141
+ [Redis] command=GET args="task:616453971:pid"
1467142
+ [Redis] call_time=0.15 ms
1467143
+  (0.0ms) SAVEPOINT active_record_1
1467144
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467145
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467146
+  (0.0ms) SAVEPOINT active_record_1
1467147
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:40.626902"], ["id", 616453971]]
1467148
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.628055' WHERE "stacks"."id" = ? [["id", 616453971]]
1467149
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467150
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467151
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467152
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467153
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467154
+ [ActiveJob] Enqueued EmitEventJob (Job ID: f1669f21-b692-498a-aadd-db841624bc26) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:40.626Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.628Z\"}}"}
1467155
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467156
+  (0.0ms) SAVEPOINT active_record_1
1467157
+ SQL (0.2ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:40.643372"], ["updated_at", "2015-12-04 14:58:40.643372"]]
1467158
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467159
+ [Redis] command=FLUSHDB args=
1467160
+ [Redis] call_time=0.17 ms
1467161
+  (0.4ms) rollback transaction
1467162
+  (0.1ms) begin transaction
1467163
+ -------------------------
1467164
+ DeploysTest: test_enqueue
1467165
+ -------------------------
1467166
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467167
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467168
+ [Redis] call_time=0.19 ms
1467169
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467170
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467171
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: fc53eb82-945a-4dd7-8816-a280eb812483) to Test(deploys) with arguments: gid://shipit/Deploy/616453971
1467172
+ [Redis] command=FLUSHDB args=
1467173
+ [Redis] call_time=0.26 ms
1467174
+  (0.1ms) rollback transaction
1467175
+  (0.0ms) begin transaction
1467176
+ -----------------------------------------------------------------------------------------------------------
1467177
+ DeploysTest: test_#accept!_first_transition_to_flapping_then_ultimately_to_success_if_the_deploy_was_failed
1467178
+ -----------------------------------------------------------------------------------------------------------
1467179
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467180
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467181
+ [Redis] call_time=0.19 ms
1467182
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467183
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467184
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 533999748]]
1467185
+  (0.0ms) SAVEPOINT active_record_1
1467186
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "flapping"], ["updated_at", "2015-12-04 14:58:40.703998"], ["id", 533999748]]
1467187
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467188
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.705955' WHERE "stacks"."id" = ? [["id", 616453971]]
1467189
+ SQL (0.3ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 1], ["updated_at", "2015-12-04 14:58:40.708024"], ["id", 533999748]]
1467190
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.709314' WHERE "stacks"."id" = ? [["id", 616453971]]
1467191
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467192
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1467193
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 3) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467194
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467195
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467196
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 83a60577-4d32-4760-b3a9-3c8ccbb5010f) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":533999748,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/533999748\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748/output\",\"type\":\"deploy\",\"status\":\"flapping\",\"updated_at\":\"2015-12-04T14:58:40.708Z\",\"created_at\":\"2015-12-04T14:00:40.000Z\",\"additions\":12,\"deletions\":64,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:40.000Z\",\"committed_at\":\"2015-11-29T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"flapping\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.709Z\"}}"}
1467197
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467198
+  (0.0ms) SAVEPOINT active_record_1
1467199
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 2], ["updated_at", "2015-12-04 14:58:40.718874"], ["id", 533999748]]
1467200
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.720015' WHERE "stacks"."id" = ? [["id", 616453971]]
1467201
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467202
+  (0.1ms) SAVEPOINT active_record_1
1467203
+ SQL (0.0ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 3], ["updated_at", "2015-12-04 14:58:40.722585"], ["id", 533999748]]
1467204
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.723480' WHERE "stacks"."id" = ? [["id", 616453971]]
1467205
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467206
+  (0.0ms) SAVEPOINT active_record_1
1467207
+ SQL (0.0ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 4], ["updated_at", "2015-12-04 14:58:40.725828"], ["id", 533999748]]
1467208
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.726738' WHERE "stacks"."id" = ? [["id", 616453971]]
1467209
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467210
+  (0.0ms) SAVEPOINT active_record_1
1467211
+ SQL (0.0ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", 5], ["updated_at", "2015-12-04 14:58:40.729061"], ["id", 533999748]]
1467212
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.729970' WHERE "stacks"."id" = ? [["id", 616453971]]
1467213
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:40.731073"], ["id", 533999748]]
1467214
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.731938' WHERE "stacks"."id" = ? [["id", 616453971]]
1467215
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 5d3549ee-0c6f-4e26-9079-88feca5b8dbd) to Test(default) with arguments: gid://shipit/Stack/616453971
1467216
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 3)) WHERE "stacks"."id" = ? [["id", 616453971]]
1467217
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 9d7e8701-f81a-41c1-8306-97489d57905a) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":533999748,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/533999748\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/533999748/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:40.731Z\",\"created_at\":\"2015-12-04T14:00:40.000Z\",\"additions\":12,\"deletions\":64,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:40.000Z\",\"committed_at\":\"2015-11-29T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.731Z\"}}"}
1467218
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467219
+ [Redis] command=FLUSHDB args=
1467220
+ [Redis] call_time=0.15 ms
1467221
+  (0.8ms) rollback transaction
1467222
+  (0.1ms) begin transaction
1467223
+ -----------------------------------------------------------------
1467224
+ DeploysTest: test_#commits_returns_empty_array_if_stack_isn't_set
1467225
+ -----------------------------------------------------------------
1467226
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467227
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467228
+ [Redis] call_time=6.38 ms
1467229
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467230
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467231
+ [Redis] command=FLUSHDB args=
1467232
+ [Redis] call_time=0.19 ms
1467233
+  (0.1ms) rollback transaction
1467234
+  (0.0ms) begin transaction
1467235
+ ---------------------------------------------------
1467236
+ DeploysTest: test_#trigger_rollback_locks_the_stack
1467237
+ ---------------------------------------------------
1467238
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467239
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467240
+ [Redis] call_time=0.20 ms
1467241
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467242
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467243
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467244
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467245
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467246
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467247
+  (0.0ms) SAVEPOINT active_record_1
1467248
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467249
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1467250
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:40.758266"], ["updated_at", "2015-12-04 14:58:40.758266"], ["additions", 432], ["deletions", 406]]
1467251
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1467252
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.762380' WHERE "stacks"."id" = ? [["id", 616453971]]
1467253
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467254
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 16e8fb76-e7f7-461c-9282-312131baad01) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1467255
+  (0.0ms) SAVEPOINT active_record_1
1467256
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1467257
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:40.767112"], ["id", 616453971]]
1467258
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467259
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d32a7b41-43f3-4a87-a2ef-8f0748c06188) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.767Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}}"}
1467260
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467261
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467262
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467263
+ [Redis] command=FLUSHDB args=
1467264
+ [Redis] call_time=0.20 ms
1467265
+  (0.6ms) rollback transaction
1467266
+  (0.0ms) begin transaction
1467267
+ -----------------------------------
1467268
+ DeploysTest: test_working_directory
1467269
+ -----------------------------------
1467270
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467271
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467272
+ [Redis] call_time=0.19 ms
1467273
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467274
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467275
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467276
+ [Redis] command=FLUSHDB args=
1467277
+ [Redis] call_time=0.12 ms
1467278
+  (0.0ms) rollback transaction
1467279
+  (0.0ms) begin transaction
1467280
+ ---------------------------------------------------------------------------------
1467281
+ DeploysTest: test_abort!_schedule_the_rollback_if_`rollback_once_aborted`_is_true
1467282
+ ---------------------------------------------------------------------------------
1467283
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467284
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467285
+ [Redis] call_time=0.15 ms
1467286
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467287
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467288
+ [Redis] command=GET args="task:616453971:pid"
1467289
+ [Redis] call_time=0.12 ms
1467290
+  (0.0ms) SAVEPOINT active_record_1
1467291
+ SQL (0.3ms) UPDATE "tasks" SET "rollback_once_aborted" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["rollback_once_aborted", "t"], ["updated_at", "2015-12-04 14:58:40.781495"], ["id", 616453971]]
1467292
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467293
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.783183' WHERE "stacks"."id" = ? [["id", 616453971]]
1467294
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467295
+  (0.0ms) SAVEPOINT active_record_1
1467296
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:40.786111"], ["id", 616453971]]
1467297
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.787443' WHERE "stacks"."id" = ? [["id", 616453971]]
1467298
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467299
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467300
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467301
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467302
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467303
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 1df8f224-a6ee-4c3b-9d2f-fe3200e57225) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:40.786Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.787Z\"}}"}
1467304
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467305
+  (0.1ms) SAVEPOINT active_record_1
1467306
+ SQL (0.2ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:40.797377"], ["updated_at", "2015-12-04 14:58:40.797377"]]
1467307
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467308
+ Deploy Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467309
+ [Redis] command=FLUSHDB args=
1467310
+ [Redis] call_time=0.19 ms
1467311
+  (0.7ms) rollback transaction
1467312
+  (0.1ms) begin transaction
1467313
+ -----------------------------------------------------------
1467314
+ DeploysTest: test_entering_flapping_state_triggers_webhooks
1467315
+ -----------------------------------------------------------
1467316
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467317
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467318
+ [Redis] call_time=0.18 ms
1467319
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467320
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467321
+  (0.0ms) SAVEPOINT active_record_1
1467322
+ SQL (0.4ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "flapping"], ["updated_at", "2015-12-04 14:58:40.804384"], ["id", 616453971]]
1467323
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467324
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.806997' WHERE "stacks"."id" = ? [["id", 616453971]]
1467325
+ SQL (0.4ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -1], ["updated_at", "2015-12-04 14:58:40.809808"], ["id", 616453971]]
1467326
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.811409' WHERE "stacks"."id" = ? [["id", 616453971]]
1467327
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467328
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467329
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467330
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467331
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467332
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d36692c0-d22f-4322-92f4-f49ee3f66c83) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"flapping\",\"updated_at\":\"2015-12-04T14:58:40.809Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"flapping\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.811Z\"}}"}
1467333
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467334
+ [Redis] command=FLUSHDB args=
1467335
+ [Redis] call_time=0.18 ms
1467336
+  (0.7ms) rollback transaction
1467337
+  (0.0ms) begin transaction
1467338
+ --------------------------------------------
1467339
+ DeploysTest: test_enqueue_when_not_persisted
1467340
+ --------------------------------------------
1467341
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467342
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467343
+ [Redis] call_time=0.19 ms
1467344
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467345
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467346
+ [Redis] command=FLUSHDB args=
1467347
+ [Redis] call_time=0.11 ms
1467348
+  (0.1ms) rollback transaction
1467349
+  (0.0ms) begin transaction
1467350
+ ------------------------------------------------------------------------
1467351
+ DeploysTest: test_#accept!_bails_out_if_the_deploy_is_successful_already
1467352
+ ------------------------------------------------------------------------
1467353
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467354
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467355
+ [Redis] call_time=0.13 ms
1467356
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467357
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467358
+ [Redis] command=FLUSHDB args=
1467359
+ [Redis] call_time=0.15 ms
1467360
+  (0.0ms) rollback transaction
1467361
+  (0.0ms) begin transaction
1467362
+ ------------------------------------------
1467363
+ DeploysTest: test_#rollback?_returns_false
1467364
+ ------------------------------------------
1467365
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467366
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467367
+ [Redis] call_time=0.16 ms
1467368
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467369
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467370
+ [Redis] command=FLUSHDB args=
1467371
+ [Redis] call_time=0.43 ms
1467372
+  (0.1ms) rollback transaction
1467373
+  (0.0ms) begin transaction
1467374
+ ---------------------------------------------------------------------
1467375
+ DeploysTest: test_#build_rollback_set_the_id_of_the_rollbacked_deploy
1467376
+ ---------------------------------------------------------------------
1467377
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467378
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467379
+ [Redis] call_time=0.14 ms
1467380
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467381
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467382
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467383
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467384
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467385
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467386
+ [Redis] command=FLUSHDB args=
1467387
+ [Redis] call_time=0.22 ms
1467388
+  (0.0ms) rollback transaction
1467389
+  (0.0ms) begin transaction
1467390
+ -----------------------------------------------------------
1467391
+ DeploysTest: test_#build_rollback_returns_an_unsaved_record
1467392
+ -----------------------------------------------------------
1467393
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467394
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467395
+ [Redis] call_time=0.14 ms
1467396
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467397
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467398
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467399
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467400
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467401
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467402
+ [Redis] command=FLUSHDB args=
1467403
+ [Redis] call_time=0.14 ms
1467404
+  (0.1ms) rollback transaction
1467405
+  (0.0ms) begin transaction
1467406
+ ------------------------------------------------------------------------
1467407
+ DeploysTest: test_#since_commit_id_returns_the_database_value_if_present
1467408
+ ------------------------------------------------------------------------
1467409
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467410
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467411
+ [Redis] call_time=0.14 ms
1467412
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467413
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467414
+ [Redis] command=FLUSHDB args=
1467415
+ [Redis] call_time=0.15 ms
1467416
+  (0.0ms) rollback transaction
1467417
+  (0.0ms) begin transaction
1467418
+ ---------------------------------------------------------------------------
1467419
+ DeploysTest: test_transitioning_to_failed_causes_an_event_to_be_broadcasted
1467420
+ ---------------------------------------------------------------------------
1467421
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467422
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467423
+ [Redis] call_time=0.14 ms
1467424
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467425
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467426
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1467427
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467428
+  (0.0ms) SAVEPOINT active_record_1
1467429
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "failed"], ["updated_at", "2015-12-04 14:58:40.851014"], ["id", 496901070]]
1467430
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.852337' WHERE "stacks"."id" = ? [["id", 616453971]]
1467431
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 5dc15172-6d92-4aba-80f3-3ae0fc6534c0) to Test(default) with arguments: gid://shipit/Stack/616453971
1467432
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467433
+ [Redis] command=FLUSHDB args=
1467434
+ [Redis] call_time=0.17 ms
1467435
+  (0.6ms) rollback transaction
1467436
+  (0.0ms) begin transaction
1467437
+ -----------------------------------------------------------------------
1467438
+ DeploysTest: test_#trigger_rollback_rolls_the_stack_back_to_this_deploy
1467439
+ -----------------------------------------------------------------------
1467440
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467441
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467442
+ [Redis] call_time=0.16 ms
1467443
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467444
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467445
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467446
+ Task Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467447
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467448
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467449
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467450
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467451
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467452
+  (0.0ms) SAVEPOINT active_record_1
1467453
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467454
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1467455
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:40.865900"], ["updated_at", "2015-12-04 14:58:40.865900"], ["additions", 432], ["deletions", 406]]
1467456
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1467457
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.869258' WHERE "stacks"."id" = ? [["id", 616453971]]
1467458
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467459
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 04b10d32-aaca-4119-832f-5c3a6fc4a171) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1467460
+  (0.0ms) SAVEPOINT active_record_1
1467461
+ Stack Exists (0.2ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1467462
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["updated_at", "2015-12-04 14:58:40.875112"], ["id", 616453971]]
1467463
+ [ActiveJob] Enqueued EmitEventJob (Job ID: b78edcf3-118e-463e-ab62-ec8723bea3d6) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.875Z\",\"lock_author\":{\"id\":null,\"name\":\"Anonymous\",\"email\":\"anonymous@example.com\",\"login\":\"anonymous\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"created_at\":\"1970-01-01T00:00:00.000Z\",\"updated_at\":\"1970-01-01T00:00:00.000Z\"}}}"}
1467464
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467465
+  (0.0ms) SAVEPOINT active_record_1
1467466
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "running"], ["updated_at", "2015-12-04 14:58:40.881149"], ["id", 783434609]]
1467467
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.882350' WHERE "stacks"."id" = ? [["id", 616453971]]
1467468
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467469
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467470
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467471
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467472
+ [ActiveJob] Enqueued EmitEventJob (Job ID: c0f48752-d87c-4e0d-b479-1c9ffcf2534f) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"running\",\"updated_at\":\"2015-12-04T14:58:40.881Z\",\"created_at\":\"2015-12-04T14:58:40.865Z\",\"additions\":432,\"deletions\":406,\"author\":{\"id\":null,\"name\":\"Anonymous\",\"email\":\"anonymous@example.com\",\"login\":\"anonymous\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"created_at\":\"1970-01-01T00:00:00.000Z\",\"updated_at\":\"1970-01-01T00:00:00.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:40.000Z\",\"committed_at\":\"2015-11-29T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}},{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"running\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.882Z\"}}"}
1467473
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467474
+  (0.1ms) SAVEPOINT active_record_1
1467475
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:40.894042"], ["id", 783434609]]
1467476
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.895379' WHERE "stacks"."id" = ? [["id", 616453971]]
1467477
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 0dd70ae4-dc3e-472e-90b1-fe66d5b0a48f) to Test(default) with arguments: gid://shipit/Stack/616453971
1467478
+ SQL (0.2ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 2)) WHERE "stacks"."id" = ? [["id", 616453971]]
1467479
+ [ActiveJob] Enqueued EmitEventJob (Job ID: f830b122-a4ec-4358-8bac-a53e64a78542) to Test(hooks) with arguments: {:event=>"rollback", :stack_id=>616453971, :payload=>"{\"rollback\":{\"id\":783434609,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/783434609\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/783434609/output\",\"type\":\"rollback\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:40.894Z\",\"created_at\":\"2015-12-04T14:58:40.865Z\",\"additions\":432,\"deletions\":406,\"author\":{\"id\":null,\"name\":\"Anonymous\",\"email\":\"anonymous@example.com\",\"login\":\"anonymous\",\"avatar_url\":\"https://github.com/images/error/octocat_happy.gif\",\"created_at\":\"1970-01-01T00:00:00.000Z\",\"updated_at\":\"1970-01-01T00:00:00.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"367578b362bf2b4df5903e1c7960929361c39074\",\"message\":\"fix it!\",\"additions\":12,\"deletions\":64,\"authored_at\":\"2015-11-28T14:58:40.000Z\",\"committed_at\":\"2015-11-29T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}},{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.895Z\"}}"}
1467480
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467481
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467482
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467483
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467484
+ [Redis] command=FLUSHDB args=
1467485
+ [Redis] call_time=0.13 ms
1467486
+  (0.8ms) rollback transaction
1467487
+  (0.0ms) begin transaction
1467488
+ ----------------------------------------------------------------------
1467489
+ DeploysTest: test_abort!_still_succeeds_if_the_process_is_already_dead
1467490
+ ----------------------------------------------------------------------
1467491
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467492
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467493
+ [Redis] call_time=0.17 ms
1467494
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467495
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467496
+ [Redis] command=GET args="task:616453971:pid"
1467497
+ [Redis] call_time=0.13 ms
1467498
+ [Redis] command=GET args="task:616453971:pid"
1467499
+ [Redis] call_time=0.15 ms
1467500
+  (0.0ms) SAVEPOINT active_record_1
1467501
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467502
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467503
+  (0.0ms) SAVEPOINT active_record_1
1467504
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:40.913272"], ["id", 616453971]]
1467505
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.914502' WHERE "stacks"."id" = ? [["id", 616453971]]
1467506
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467507
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467508
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467509
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467510
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467511
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 2f5213a0-0281-4e41-83d3-4ab192c983ad) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:40.913Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.914Z\"}}"}
1467512
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467513
+  (0.0ms) SAVEPOINT active_record_1
1467514
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:40.926137"], ["updated_at", "2015-12-04 14:58:40.926137"]]
1467515
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467516
+  (0.0ms) SAVEPOINT active_record_1
1467517
+ SQL (0.3ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: PID 42 ESRCH: No such process\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:40.927668"], ["updated_at", "2015-12-04 14:58:40.927668"]]
1467518
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467519
+  (0.0ms) SAVEPOINT active_record_1
1467520
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborted"], ["updated_at", "2015-12-04 14:58:40.930521"], ["id", 616453971]]
1467521
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.932101' WHERE "stacks"."id" = ? [["id", 616453971]]
1467522
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 02456395-d8a2-4adc-85b6-8d1e80310b7b) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborted\",\"updated_at\":\"2015-12-04T14:58:40.930Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborted\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.932Z\"}}"}
1467523
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467524
+ [Redis] command=FLUSHDB args=
1467525
+ [Redis] call_time=0.18 ms
1467526
+  (0.7ms) rollback transaction
1467527
+  (0.1ms) begin transaction
1467528
+ ----------------------------------------------------------------------------
1467529
+ DeploysTest: test_transitioning_to_running_causes_an_event_to_be_broadcasted
1467530
+ ----------------------------------------------------------------------------
1467531
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467532
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467533
+ [Redis] call_time=0.23 ms
1467534
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467535
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467536
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1467537
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467538
+  (0.1ms) SAVEPOINT active_record_1
1467539
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "running"], ["updated_at", "2015-12-04 14:58:40.948382"], ["id", 496901070]]
1467540
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.949914' WHERE "stacks"."id" = ? [["id", 616453971]]
1467541
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467542
+ [Redis] command=FLUSHDB args=
1467543
+ [Redis] call_time=0.15 ms
1467544
+  (0.5ms) rollback transaction
1467545
+  (0.0ms) begin transaction
1467546
+ ----------------------------------------------------
1467547
+ DeploysTest: test_abort!_bails_out_if_the_PID_is_nil
1467548
+ ----------------------------------------------------
1467549
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467550
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467551
+ [Redis] call_time=0.15 ms
1467552
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467553
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467554
+ [Redis] command=SET args="task:616453971:pid" "" "EX" 3600
1467555
+ [Redis] call_time=0.13 ms
1467556
+ [Redis] command=GET args="task:616453971:pid"
1467557
+ [Redis] call_time=0.12 ms
1467558
+  (0.1ms) SAVEPOINT active_record_1
1467559
+ SQL (0.3ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: failed, PID unknown\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:40.957435"], ["updated_at", "2015-12-04 14:58:40.957435"]]
1467560
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467561
+ [Redis] command=FLUSHDB args=
1467562
+ [Redis] call_time=0.16 ms
1467563
+  (0.4ms) rollback transaction
1467564
+  (0.0ms) begin transaction
1467565
+ --------------------------------------------------------------------
1467566
+ DeploysTest: test_#reject!_bails_out_if_the_deploy_is_failed_already
1467567
+ --------------------------------------------------------------------
1467568
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467569
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467570
+ [Redis] call_time=0.14 ms
1467571
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467572
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467573
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 533999748]]
1467574
+ [Redis] command=FLUSHDB args=
1467575
+ [Redis] call_time=0.17 ms
1467576
+  (0.1ms) rollback transaction
1467577
+  (0.0ms) begin transaction
1467578
+ --------------------------------------------------------------------------
1467579
+ DeploysTest: test_#chunk_output_joins_all_chunk_test_if_logs_not_rolled_up
1467580
+ --------------------------------------------------------------------------
1467581
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467582
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467583
+ [Redis] call_time=0.14 ms
1467584
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467585
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467586
+  (0.1ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1467587
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1467588
+  (0.1ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1467589
+  (0.0ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1467590
+ [Redis] command=FLUSHDB args=
1467591
+ [Redis] call_time=0.13 ms
1467592
+  (0.0ms) rollback transaction
1467593
+  (0.1ms) begin transaction
1467594
+ ---------------------------------------------------------------------------
1467595
+ DeploysTest: test_additions_and_deletions_are_denormalized_on_before_create
1467596
+ ---------------------------------------------------------------------------
1467597
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467598
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467599
+ [Redis] call_time=0.13 ms
1467600
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467601
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467602
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1467603
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1467604
+  (0.0ms) SAVEPOINT active_record_1
1467605
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467606
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 3) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467607
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "since_commit_id", "until_commit_id", "stack_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["type", "Deploy"], ["since_commit_id", 1], ["until_commit_id", 3], ["stack_id", 616453971], ["created_at", "2015-12-04 14:58:40.973218"], ["updated_at", "2015-12-04 14:58:40.973218"], ["additions", 13], ["deletions", 65]]
1467608
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1467609
+ SQL (0.5ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.976568' WHERE "stacks"."id" = ? [["id", 616453971]]
1467610
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467611
+ [Redis] command=FLUSHDB args=
1467612
+ [Redis] call_time=0.11 ms
1467613
+  (0.6ms) rollback transaction
1467614
+  (0.0ms) begin transaction
1467615
+ --------------------------------------------------------------------
1467616
+ DeploysTest: test_#since_commit_id_returns_nil_if_stack_id_isn't_set
1467617
+ --------------------------------------------------------------------
1467618
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467619
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467620
+ [Redis] call_time=0.14 ms
1467621
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467622
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467623
+ [Redis] command=FLUSHDB args=
1467624
+ [Redis] call_time=0.11 ms
1467625
+  (0.0ms) rollback transaction
1467626
+  (0.1ms) begin transaction
1467627
+ ------------------------------------------------------------------------------------
1467628
+ DeploysTest: test_transitioning_to_success_skips_CD_deploy_when_stack_doesn't_use_it
1467629
+ ------------------------------------------------------------------------------------
1467630
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467631
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467632
+ [Redis] call_time=0.15 ms
1467633
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467634
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467635
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1467636
+  (0.0ms) SAVEPOINT active_record_1
1467637
+ SQL (0.4ms) INSERT INTO "statuses" ("state", "commit_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["state", "success"], ["commit_id", 5], ["created_at", "2015-12-04 14:58:40.992440"], ["updated_at", "2015-12-04 14:58:40.992440"]]
1467638
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1467639
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467640
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:40.996586' WHERE "commits"."id" = ? [["id", 5]]
1467641
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.997387' WHERE "stacks"."id" = ? [["id", 616453971]]
1467642
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.997940' WHERE "stacks"."id" = ? [["id", 616453971]]
1467643
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:40.998854' WHERE "commits"."id" = ? [["id", 5]]
1467644
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.999359' WHERE "stacks"."id" = ? [["id", 616453971]]
1467645
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:40.999826' WHERE "stacks"."id" = ? [["id", 616453971]]
1467646
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" = ? ORDER BY "statuses"."created_at" DESC [["commit_id", 5]]
1467647
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467648
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1467649
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1467650
+  (0.1ms) SAVEPOINT active_record_1
1467651
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:41.013845"], ["id", 644540443]]
1467652
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467653
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.015759' WHERE "stacks"."id" = ? [["id", 616453971]]
1467654
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 738a15f7-f8d2-4fe1-ada0-c475090b5fd5) to Test(default) with arguments: gid://shipit/Stack/616453971
1467655
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467656
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1467657
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467658
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467659
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467660
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467661
+ [ActiveJob] Enqueued EmitEventJob (Job ID: fb959881-cc55-4c93-b70d-2a61cd068d24) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:41.013Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.015Z\"}}"}
1467662
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467663
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1467664
+ [Redis] command=FLUSHDB args=
1467665
+ [Redis] call_time=0.18 ms
1467666
+  (0.9ms) rollback transaction
1467667
+  (0.0ms) begin transaction
1467668
+ ----------------------------------------------------------------------------------
1467669
+ DeploysTest: test_transitioning_to_error_schedule_a_fetch_of_the_deployed_revision
1467670
+ ----------------------------------------------------------------------------------
1467671
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467672
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467673
+ [Redis] call_time=0.15 ms
1467674
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467675
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467676
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1467677
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467678
+  (0.0ms) SAVEPOINT active_record_1
1467679
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "error"], ["updated_at", "2015-12-04 14:58:41.034527"], ["id", 644540443]]
1467680
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.035804' WHERE "stacks"."id" = ? [["id", 616453971]]
1467681
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 8a51aa7b-a9a7-49a9-9012-871136ec06ea) to Test(default) with arguments: gid://shipit/Stack/616453971
1467682
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467683
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467684
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467685
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467686
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467687
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 5224faae-c8fb-4ef9-8f40-938e58e2f452) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"error\",\"updated_at\":\"2015-12-04T14:58:41.034Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"error\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.035Z\"}}"}
1467688
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467689
+ [Redis] command=FLUSHDB args=
1467690
+ [Redis] call_time=0.23 ms
1467691
+  (0.5ms) rollback transaction
1467692
+  (0.0ms) begin transaction
1467693
+ -----------------------------------------------------
1467694
+ DeploysTest: test_#trigger_rollback_schedule_the_task
1467695
+ -----------------------------------------------------
1467696
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467697
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467698
+ [Redis] call_time=0.14 ms
1467699
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467700
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467701
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467702
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467703
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467704
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467705
+  (0.0ms) SAVEPOINT active_record_1
1467706
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467707
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1467708
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:41.053552"], ["updated_at", "2015-12-04 14:58:41.053552"], ["additions", 432], ["deletions", 406]]
1467709
+ SQL (0.2ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1467710
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.057047' WHERE "stacks"."id" = ? [["id", 616453971]]
1467711
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467712
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: d496dd6d-817a-42c7-84ca-6c8da0fb6004) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1467713
+  (0.0ms) SAVEPOINT active_record_1
1467714
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1467715
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:41.061700"], ["id", 616453971]]
1467716
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467717
+ [Redis] command=FLUSHDB args=
1467718
+ [Redis] call_time=0.17 ms
1467719
+  (0.8ms) rollback transaction
1467720
+  (0.2ms) begin transaction
1467721
+ ----------------------------------
1467722
+ DeploysTest: test_pid_is_persisted
1467723
+ ----------------------------------
1467724
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467725
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467726
+ [Redis] call_time=0.19 ms
1467727
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467728
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467729
+ Deploy Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467730
+ [Redis] command=GET args="task:616453971:pid"
1467731
+ [Redis] call_time=0.12 ms
1467732
+ [Redis] command=FLUSHDB args=
1467733
+ [Redis] call_time=0.11 ms
1467734
+  (0.1ms) rollback transaction
1467735
+  (0.0ms) begin transaction
1467736
+ -------------------------------------------------------------------------------
1467737
+ DeploysTest: test_abort!_transition_to_`aborted`_if_the_process_is_already_dead
1467738
+ -------------------------------------------------------------------------------
1467739
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467740
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467741
+ [Redis] call_time=0.13 ms
1467742
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467743
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467744
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1467745
+ [Redis] command=SET args="task:644540443:pid" "42" "EX" 3600
1467746
+ [Redis] call_time=0.18 ms
1467747
+ [Redis] command=GET args="task:644540443:pid"
1467748
+ [Redis] call_time=0.12 ms
1467749
+  (0.0ms) SAVEPOINT active_record_1
1467750
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467751
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467752
+  (0.0ms) SAVEPOINT active_record_1
1467753
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:41.076476"], ["id", 644540443]]
1467754
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.077923' WHERE "stacks"."id" = ? [["id", 616453971]]
1467755
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467756
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467757
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467758
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467759
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467760
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 76b06652-8bce-4ecc-a320-00e3af1c1342) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:41.076Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.077Z\"}}"}
1467761
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467762
+  (0.1ms) SAVEPOINT active_record_1
1467763
+ SQL (0.2ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:41.088130"], ["updated_at", "2015-12-04 14:58:41.088130"]]
1467764
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467765
+ [Redis] command=GET args="task:644540443:pid"
1467766
+ [Redis] call_time=0.21 ms
1467767
+ [Redis] command=GET args="task:644540443:pid"
1467768
+ [Redis] call_time=0.16 ms
1467769
+  (0.1ms) SAVEPOINT active_record_1
1467770
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467771
+  (0.0ms) SAVEPOINT active_record_1
1467772
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467773
+  (0.0ms) SAVEPOINT active_record_1
1467774
+ SQL (0.4ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:41.095786"], ["updated_at", "2015-12-04 14:58:41.095786"]]
1467775
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467776
+  (0.0ms) SAVEPOINT active_record_1
1467777
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: PID 42 ESRCH: No such process\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:41.097931"], ["updated_at", "2015-12-04 14:58:41.097931"]]
1467778
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1467779
+  (0.0ms) SAVEPOINT active_record_1
1467780
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborted"], ["updated_at", "2015-12-04 14:58:41.100793"], ["id", 644540443]]
1467781
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.102816' WHERE "stacks"."id" = ? [["id", 616453971]]
1467782
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 109566bc-0af8-4879-ba70-36dab8989a16) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborted\",\"updated_at\":\"2015-12-04T14:58:41.100Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborted\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.102Z\"}}"}
1467783
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467784
+ [Redis] command=FLUSHDB args=
1467785
+ [Redis] call_time=0.10 ms
1467786
+  (0.7ms) rollback transaction
1467787
+  (0.0ms) begin transaction
1467788
+ ------------------------------------------------------------------------------------
1467789
+ DeploysTest: test_transitioning_to_success_schedule_a_fetch_of_the_deployed_revision
1467790
+ ------------------------------------------------------------------------------------
1467791
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467792
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467793
+ [Redis] call_time=0.17 ms
1467794
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467795
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467796
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1467797
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467798
+  (0.0ms) SAVEPOINT active_record_1
1467799
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:41.116260"], ["id", 644540443]]
1467800
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.117625' WHERE "stacks"."id" = ? [["id", 616453971]]
1467801
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: cbe4e393-333f-4425-9871-3361c00baf23) to Test(default) with arguments: gid://shipit/Stack/616453971
1467802
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467803
+ SQL (0.3ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1467804
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467805
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467806
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467807
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467808
+ [ActiveJob] Enqueued EmitEventJob (Job ID: a6fae4ee-f9ea-47e6-a597-055487a8764a) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:41.116Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.117Z\"}}"}
1467809
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467810
+ [Redis] command=FLUSHDB args=
1467811
+ [Redis] call_time=0.17 ms
1467812
+  (0.8ms) rollback transaction
1467813
+  (0.1ms) begin transaction
1467814
+ -----------------------------------------------------------------------------
1467815
+ DeploysTest: test_#since_commit_id_returns_a_default_value_if_stack_id_is_set
1467816
+ -----------------------------------------------------------------------------
1467817
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467818
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467819
+ [Redis] call_time=0.21 ms
1467820
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467821
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467822
+ Deploy Load (0.2ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."stack_id" = ? AND "tasks"."status" = ? ORDER BY "tasks"."id" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467823
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467824
+ Deploy Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."stack_id" = ? AND "tasks"."status" = ? ORDER BY "tasks"."id" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467825
+ [Redis] command=FLUSHDB args=
1467826
+ [Redis] call_time=0.17 ms
1467827
+  (0.1ms) rollback transaction
1467828
+  (0.0ms) begin transaction
1467829
+ --------------------------------------------------------------
1467830
+ DeploysTest: test_#commits_returns_the_commits_in_the_id_range
1467831
+ --------------------------------------------------------------
1467832
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467833
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467834
+ [Redis] call_time=0.17 ms
1467835
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467836
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467837
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1467838
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1467839
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467840
+  (0.1ms) SELECT COUNT(*) FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 3) [["stack_id", 616453971]]
1467841
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 3) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467842
+ [Redis] command=FLUSHDB args=
1467843
+ [Redis] call_time=0.21 ms
1467844
+  (0.1ms) rollback transaction
1467845
+  (0.0ms) begin transaction
1467846
+ -------------------------------------------------------------------------------------------
1467847
+ DeploysTest: test_#build_rollback_set_the_last_deployed_commit_as_the_rollback_since_commit
1467848
+ -------------------------------------------------------------------------------------------
1467849
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467850
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467851
+ [Redis] call_time=0.20 ms
1467852
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467853
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467854
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467855
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467856
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467857
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467858
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467859
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467860
+ [Redis] command=FLUSHDB args=
1467861
+ [Redis] call_time=0.17 ms
1467862
+  (0.0ms) rollback transaction
1467863
+  (0.0ms) begin transaction
1467864
+ ----------------------------------------------------
1467865
+ DeploysTest: test_#build_rollback_returns_a_rollback
1467866
+ ----------------------------------------------------
1467867
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467868
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467869
+ [Redis] call_time=0.20 ms
1467870
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467871
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467872
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467873
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1467874
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467875
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467876
+ [Redis] command=FLUSHDB args=
1467877
+ [Redis] call_time=0.20 ms
1467878
+  (0.1ms) rollback transaction
1467879
+  (0.1ms) begin transaction
1467880
+ -------------------------------------------------------------------------------------------------
1467881
+ DeploysTest: test_transitioning_to_success_skips_CD_when_no_successful_commits_after_until_commit
1467882
+ -------------------------------------------------------------------------------------------------
1467883
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467884
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467885
+ [Redis] call_time=0.23 ms
1467886
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467887
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467888
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1467889
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467890
+  (0.0ms) SAVEPOINT active_record_1
1467891
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1467892
+ SQL (0.3ms) UPDATE "stacks" SET "continuous_deployment" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["continuous_deployment", "t"], ["updated_at", "2015-12-04 14:58:41.166072"], ["id", 616453971]]
1467893
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467894
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1467895
+  (0.0ms) SAVEPOINT active_record_1
1467896
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:41.170353"], ["id", 644540443]]
1467897
+ SQL (0.4ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.171610' WHERE "stacks"."id" = ? [["id", 616453971]]
1467898
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: e92c9e5b-8028-4041-a1fe-f9948dbe9abc) to Test(default) with arguments: gid://shipit/Stack/616453971
1467899
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467900
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND (id > 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1467901
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" IN (5) ORDER BY "statuses"."created_at" DESC
1467902
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1467903
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467904
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467905
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467906
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467907
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 3780d047-0773-4e8e-a1b8-63c4c41fe1ce) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:41.170Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":true,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.171Z\"}}"}
1467908
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467909
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1467910
+ [Redis] command=FLUSHDB args=
1467911
+ [Redis] call_time=0.23 ms
1467912
+  (0.8ms) rollback transaction
1467913
+  (0.1ms) begin transaction
1467914
+ --------------------------------------------------------------------------------------------------------------
1467915
+ DeploysTest: test_#reject!_first_transition_to_flapping_then_ultimately_to_failed_if_the_deploy_was_successful
1467916
+ --------------------------------------------------------------------------------------------------------------
1467917
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467918
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467919
+ [Redis] call_time=0.19 ms
1467920
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467921
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467922
+  (0.1ms) SAVEPOINT active_record_1
1467923
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "flapping"], ["updated_at", "2015-12-04 14:58:41.195731"], ["id", 616453971]]
1467924
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467925
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.198111' WHERE "stacks"."id" = ? [["id", 616453971]]
1467926
+ SQL (0.4ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -1], ["updated_at", "2015-12-04 14:58:41.200758"], ["id", 616453971]]
1467927
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.202598' WHERE "stacks"."id" = ? [["id", 616453971]]
1467928
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467929
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1467930
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467931
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467932
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467933
+ [ActiveJob] Enqueued EmitEventJob (Job ID: b9056da7-7c52-4d78-966f-59d95705f85a) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"flapping\",\"updated_at\":\"2015-12-04T14:58:41.200Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"flapping\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.202Z\"}}"}
1467934
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467935
+  (0.1ms) SAVEPOINT active_record_1
1467936
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -2], ["updated_at", "2015-12-04 14:58:41.213613"], ["id", 616453971]]
1467937
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.215304' WHERE "stacks"."id" = ? [["id", 616453971]]
1467938
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467939
+  (0.0ms) SAVEPOINT active_record_1
1467940
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -3], ["updated_at", "2015-12-04 14:58:41.218582"], ["id", 616453971]]
1467941
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.219763' WHERE "stacks"."id" = ? [["id", 616453971]]
1467942
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467943
+  (0.0ms) SAVEPOINT active_record_1
1467944
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -4], ["updated_at", "2015-12-04 14:58:41.222642"], ["id", 616453971]]
1467945
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.223802' WHERE "stacks"."id" = ? [["id", 616453971]]
1467946
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467947
+  (0.1ms) SAVEPOINT active_record_1
1467948
+ SQL (0.1ms) UPDATE "tasks" SET "confirmations" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["confirmations", -5], ["updated_at", "2015-12-04 14:58:41.226911"], ["id", 616453971]]
1467949
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.228085' WHERE "stacks"."id" = ? [["id", 616453971]]
1467950
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "failed"], ["updated_at", "2015-12-04 14:58:41.229430"], ["id", 616453971]]
1467951
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.230410' WHERE "stacks"."id" = ? [["id", 616453971]]
1467952
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 6218155a-c6e6-43a3-a81e-17cb342b529c) to Test(default) with arguments: gid://shipit/Stack/616453971
1467953
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d1eac97a-f995-47d5-b8e7-cd70289097d5) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"failed\",\"updated_at\":\"2015-12-04T14:58:41.229Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"failed\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.230Z\"}}"}
1467954
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467955
+ [Redis] command=FLUSHDB args=
1467956
+ [Redis] call_time=0.13 ms
1467957
+  (0.8ms) rollback transaction
1467958
+  (0.0ms) begin transaction
1467959
+ --------------------------------------------------------------
1467960
+ DeploysTest: test_#commits_returns_commits_from_newer_to_older
1467961
+ --------------------------------------------------------------
1467962
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467963
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467964
+ [Redis] call_time=0.14 ms
1467965
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467966
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467967
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 1]]
1467968
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467969
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467970
+  (0.1ms) SELECT "commits"."id" FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467971
+ [Redis] command=FLUSHDB args=
1467972
+ [Redis] call_time=0.31 ms
1467973
+  (0.1ms) rollback transaction
1467974
+  (0.1ms) begin transaction
1467975
+ ------------------------------------------------------------------------------------
1467976
+ DeploysTest: test_transitioning_to_failure_schedule_a_fetch_of_the_deployed_revision
1467977
+ ------------------------------------------------------------------------------------
1467978
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1467979
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1467980
+ [Redis] call_time=0.24 ms
1467981
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467982
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467983
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1467984
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1467985
+  (0.1ms) SAVEPOINT active_record_1
1467986
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "failed"], ["updated_at", "2015-12-04 14:58:41.261158"], ["id", 644540443]]
1467987
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.262841' WHERE "stacks"."id" = ? [["id", 616453971]]
1467988
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: bf64e809-5595-4129-9519-e2eae78fecd5) to Test(default) with arguments: gid://shipit/Stack/616453971
1467989
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467990
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1467991
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1467992
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467993
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1467994
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 0823a6d3-7106-4417-9e70-d2838d2741b3) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"failed\",\"updated_at\":\"2015-12-04T14:58:41.261Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"failed\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.262Z\"}}"}
1467995
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1467996
+ [Redis] command=FLUSHDB args=
1467997
+ [Redis] call_time=0.14 ms
1467998
+  (0.5ms) rollback transaction
1467999
+  (0.1ms) begin transaction
1468000
+ ----------------------------------------------------------
1468001
+ DeploysTest: test_#trigger_rollback_creates_a_new_Rollback
1468002
+ ----------------------------------------------------------
1468003
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468004
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468005
+ [Redis] call_time=0.15 ms
1468006
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468007
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468008
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback')
1468009
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468010
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1468011
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1468012
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1468013
+  (0.0ms) SAVEPOINT active_record_1
1468014
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468015
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 2) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1468016
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 616453971], ["since_commit_id", 4], ["until_commit_id", 2], ["created_at", "2015-12-04 14:58:41.283173"], ["updated_at", "2015-12-04 14:58:41.283173"], ["additions", 432], ["deletions", 406]]
1468017
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1468018
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.286341' WHERE "stacks"."id" = ? [["id", 616453971]]
1468019
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1468020
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 1b4070b2-b791-46a1-bdd5-ad2cb12dcb17) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1468021
+  (0.0ms) SAVEPOINT active_record_1
1468022
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1468023
+ SQL (0.1ms) UPDATE "stacks" SET "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:41.290769"], ["id", 616453971]]
1468024
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468025
+ [ActiveJob] Enqueued EmitEventJob (Job ID: b50e99c8-b218-45d9-8fbc-f4b95888e5f2) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.290Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}}"}
1468026
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468027
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback')
1468028
+ [Redis] command=FLUSHDB args=
1468029
+ [Redis] call_time=0.20 ms
1468030
+  (0.7ms) rollback transaction
1468031
+  (0.1ms) begin transaction
1468032
+ -----------------------------------------------------------
1468033
+ DeploysTest: test_destroy_deletes_the_related_output_chunks
1468034
+ -----------------------------------------------------------
1468035
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468036
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468037
+ [Redis] call_time=0.16 ms
1468038
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468039
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468040
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1468041
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1468042
+  (0.0ms) SAVEPOINT active_record_1
1468043
+ OutputChunk Load (0.1ms) SELECT "output_chunks".* FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1468044
+ SQL (0.2ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 28353825]]
1468045
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 414839965]]
1468046
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 533999748]]
1468047
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 616453971]]
1468048
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 684916759]]
1468049
+ SQL (0.0ms) DELETE FROM "output_chunks" WHERE "output_chunks"."id" = ? [["id", 918001080]]
1468050
+ SQL (0.2ms) DELETE FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."id" = ? [["id", 616453971]]
1468051
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468052
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) - 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1468053
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.306861' WHERE "stacks"."id" = ? [["id", 616453971]]
1468054
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1468055
+  (0.0ms) SELECT COUNT(*) FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1468056
+ [Redis] command=FLUSHDB args=
1468057
+ [Redis] call_time=0.15 ms
1468058
+  (0.7ms) rollback transaction
1468059
+  (0.1ms) begin transaction
1468060
+ ----------------------------------------------------------------------------
1468061
+ DeploysTest: test_transitioning_to_success_causes_an_event_to_be_broadcasted
1468062
+ ----------------------------------------------------------------------------
1468063
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468064
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468065
+ [Redis] call_time=0.16 ms
1468066
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468067
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468068
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 496901070]]
1468069
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468070
+  (0.0ms) SAVEPOINT active_record_1
1468071
+ SQL (0.2ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:41.316465"], ["id", 496901070]]
1468072
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.317752' WHERE "stacks"."id" = ? [["id", 616453971]]
1468073
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 063efbe1-ddf3-47da-b722-c05cc1c70f35) to Test(default) with arguments: gid://shipit/Stack/616453971
1468074
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1468075
+ SQL (0.3ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1468076
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468077
+ [Redis] command=FLUSHDB args=
1468078
+ [Redis] call_time=0.23 ms
1468079
+  (0.8ms) rollback transaction
1468080
+  (0.0ms) begin transaction
1468081
+ -------------------------------------------------
1468082
+ DeploysTest: test_abort!_transition_to_`aborting`
1468083
+ -------------------------------------------------
1468084
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468085
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468086
+ [Redis] call_time=0.23 ms
1468087
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468088
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468089
+ [Redis] command=GET args="task:616453971:pid"
1468090
+ [Redis] call_time=0.16 ms
1468091
+  (0.1ms) SAVEPOINT active_record_1
1468092
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468093
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468094
+  (0.0ms) SAVEPOINT active_record_1
1468095
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:41.330334"], ["id", 616453971]]
1468096
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.331638' WHERE "stacks"."id" = ? [["id", 616453971]]
1468097
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468098
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 2]]
1468099
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 2) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1468100
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468101
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468102
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 015df745-c5c9-4c64-9469-caa102f8d6af) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":616453971,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/616453971\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/616453971/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:41.330Z\",\"created_at\":\"2015-12-04T13:59:40.000Z\",\"additions\":1,\"deletions\":1,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\"},\"commits\":[{\"sha\":\"f890fd8b5f2be05d1fedb763a3605ee461c39074\",\"message\":\"sheep it!\",\"additions\":1,\"deletions\":1,\"authored_at\":\"2015-11-26T14:58:40.000Z\",\"committed_at\":\"2015-11-27T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.331Z\"}}"}
1468103
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468104
+  (0.1ms) SAVEPOINT active_record_1
1468105
+ SQL (0.2ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 616453971], ["created_at", "2015-12-04 14:58:41.341805"], ["updated_at", "2015-12-04 14:58:41.341805"]]
1468106
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468107
+ [Redis] command=FLUSHDB args=
1468108
+ [Redis] call_time=0.18 ms
1468109
+  (0.6ms) rollback transaction
1468110
+  (0.1ms) begin transaction
1468111
+ ---------------------------------------------------------------------
1468112
+ DeploysTest: test_creating_a_deploy_causes_an_event_to_be_broadcasted
1468113
+ ---------------------------------------------------------------------
1468114
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468115
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468116
+ [Redis] call_time=0.20 ms
1468117
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468118
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468119
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? ORDER BY "commits"."id" ASC LIMIT 1 [["stack_id", 616453971]]
1468120
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? ORDER BY "commits"."id" DESC LIMIT 1 [["stack_id", 616453971]]
1468121
+  (0.0ms) SAVEPOINT active_record_1
1468122
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468123
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 1) AND (id <= 5) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1468124
+ SQL (0.3ms) INSERT INTO "tasks" ("type", "since_commit_id", "until_commit_id", "stack_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["type", "Deploy"], ["since_commit_id", 1], ["until_commit_id", 5], ["stack_id", 616453971], ["created_at", "2015-12-04 14:58:41.352372"], ["updated_at", "2015-12-04 14:58:41.352372"], ["additions", 434], ["deletions", 431]]
1468125
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1468126
+ SQL (0.3ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.356459' WHERE "stacks"."id" = ? [["id", 616453971]]
1468127
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1468128
+ [Redis] command=FLUSHDB args=
1468129
+ [Redis] call_time=0.18 ms
1468130
+  (0.8ms) rollback transaction
1468131
+  (0.1ms) begin transaction
1468132
+ ----------------------------------------------------------------------
1468133
+ DeploysTest: test_#chunk_output_returns_logs_from_records_if_rolled_up
1468134
+ ----------------------------------------------------------------------
1468135
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468136
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468137
+ [Redis] call_time=0.20 ms
1468138
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468139
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468140
+  (0.0ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1468141
+  (0.0ms) SAVEPOINT active_record_1
1468142
+  (0.0ms) SELECT "output_chunks"."text" FROM "output_chunks" WHERE "output_chunks"."task_id" = ? ORDER BY "output_chunks"."id" ASC [["task_id", 616453971]]
1468143
+ SQL (0.3ms) DELETE FROM "output_chunks" WHERE "output_chunks"."task_id" = ? [["task_id", 616453971]]
1468144
+ SQL (0.1ms) UPDATE "tasks" SET "gzip_output" = ?, "rolled_up" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["gzip_output", "<110 bytes of binary data>"], ["rolled_up", "t"], ["updated_at", "2015-12-04 14:58:41.365290"], ["id", 616453971]]
1468145
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468146
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.367687' WHERE "stacks"."id" = ? [["id", 616453971]]
1468147
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468148
+ [Redis] command=FLUSHDB args=
1468149
+ [Redis] call_time=0.15 ms
1468150
+  (0.4ms) rollback transaction
1468151
+  (0.0ms) begin transaction
1468152
+ ----------------------------------------------------------------------------------
1468153
+ DeploysTest: test_transitioning_to_success_triggers_next_deploy_when_stack_uses_CD
1468154
+ ----------------------------------------------------------------------------------
1468155
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468156
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468157
+ [Redis] call_time=0.14 ms
1468158
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468159
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468160
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1468161
+  (0.0ms) SAVEPOINT active_record_1
1468162
+ SQL (0.2ms) INSERT INTO "statuses" ("state", "commit_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["state", "success"], ["commit_id", 5], ["created_at", "2015-12-04 14:58:41.375878"], ["updated_at", "2015-12-04 14:58:41.375878"]]
1468163
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 5]]
1468164
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468165
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:41.378361' WHERE "commits"."id" = ? [["id", 5]]
1468166
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.379131' WHERE "stacks"."id" = ? [["id", 616453971]]
1468167
+ SQL (0.2ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.379674' WHERE "stacks"."id" = ? [["id", 616453971]]
1468168
+ SQL (0.1ms) UPDATE "commits" SET "updated_at" = '2015-12-04 14:58:41.380485' WHERE "commits"."id" = ? [["id", 5]]
1468169
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.381056' WHERE "stacks"."id" = ? [["id", 616453971]]
1468170
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.381527' WHERE "stacks"."id" = ? [["id", 616453971]]
1468171
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" = ? ORDER BY "statuses"."created_at" DESC [["commit_id", 5]]
1468172
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468173
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1468174
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468175
+  (0.0ms) SAVEPOINT active_record_1
1468176
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1468177
+ SQL (0.1ms) UPDATE "stacks" SET "continuous_deployment" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["continuous_deployment", "t"], ["updated_at", "2015-12-04 14:58:41.388535"], ["id", 616453971]]
1468178
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1468179
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1468180
+  (0.0ms) SAVEPOINT active_record_1
1468181
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "success"], ["updated_at", "2015-12-04 14:58:41.392282"], ["id", 644540443]]
1468182
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.393493' WHERE "stacks"."id" = ? [["id", 616453971]]
1468183
+ [ActiveJob] Enqueued FetchDeployedRevisionJob (Job ID: 4ecfe20b-4386-4c61-8558-efcb36b68487) to Test(default) with arguments: gid://shipit/Stack/616453971
1468184
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1468185
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND (id > 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1468186
+ Status Load (0.1ms) SELECT "statuses".* FROM "statuses" WHERE "statuses"."commit_id" IN (5) ORDER BY "statuses"."created_at" DESC
1468187
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468188
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."stack_id" = ? AND "tasks"."type" IN ('Deploy', 'Rollback') AND "tasks"."status" = ? ORDER BY "tasks"."created_at" DESC LIMIT 1 [["stack_id", 616453971], ["status", "success"]]
1468189
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1468190
+ Stack Load (0.1ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468191
+ Commit Load (0.2ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 4) AND (id <= 5) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1468192
+ SQL (0.2ms) INSERT INTO "tasks" ("type", "user_id", "until_commit_id", "since_commit_id", "stack_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Deploy"], ["user_id", 1047960473], ["until_commit_id", 5], ["since_commit_id", 4], ["stack_id", 616453971], ["created_at", "2015-12-04 14:58:41.402534"], ["updated_at", "2015-12-04 14:58:41.402534"], ["additions", 1], ["deletions", 24]]
1468193
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1468194
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.407082' WHERE "stacks"."id" = ? [["id", 616453971]]
1468195
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 8e1763e0-133a-4096-b9cd-acd0d69a734c) to Test(deploys) with arguments: gid://shipit/Deploy/783434609
1468196
+ SQL (0.1ms) UPDATE "stacks" SET undeployed_commits_count = (SELECT count(*) as count FROM "commits" WHERE "commits"."stack_id" = 616453971 AND "commits"."detached" = 'f' AND (id > 4)) WHERE "stacks"."id" = ? [["id", 616453971]]
1468197
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468198
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1468199
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468200
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468201
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 161e4a66-145c-4669-9a57-9de84114800d) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"success\",\"updated_at\":\"2015-12-04T14:58:41.392Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"success\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":true,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.393Z\"}}"}
1468202
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468203
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Deploy', 'Rollback')
1468204
+ [Redis] command=FLUSHDB args=
1468205
+ [Redis] call_time=0.12 ms
1468206
+  (0.8ms) rollback transaction
1468207
+  (0.0ms) begin transaction
1468208
+ --------------------------------------------------------------------------
1468209
+ DeploysTest: test_transitioning_to_aborted_schedule_a_rollback_if_required
1468210
+ --------------------------------------------------------------------------
1468211
+ Task Load (0.1ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 616453971]]
1468212
+ [Redis] command=SET args="task:616453971:pid" "42" "EX" 3600
1468213
+ [Redis] call_time=0.15 ms
1468214
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468215
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468216
+ Task Load (0.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = ? LIMIT 1 [["id", 644540443]]
1468217
+ [Redis] command=SET args="task:644540443:pid" "42" "EX" 3600
1468218
+ [Redis] call_time=0.12 ms
1468219
+ [Redis] command=GET args="task:644540443:pid"
1468220
+ [Redis] call_time=0.15 ms
1468221
+  (0.0ms) SAVEPOINT active_record_1
1468222
+ SQL (0.2ms) UPDATE "tasks" SET "rollback_once_aborted" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["rollback_once_aborted", "t"], ["updated_at", "2015-12-04 14:58:41.424506"], ["id", 644540443]]
1468223
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468224
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.426164' WHERE "stacks"."id" = ? [["id", 616453971]]
1468225
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1468226
+  (0.0ms) SAVEPOINT active_record_1
1468227
+ SQL (0.3ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborting"], ["updated_at", "2015-12-04 14:58:41.428930"], ["id", 644540443]]
1468228
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.430183' WHERE "stacks"."id" = ? [["id", 616453971]]
1468229
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468230
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 4]]
1468231
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" DESC [["stack_id", 616453971]]
1468232
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468233
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468234
+ [ActiveJob] Enqueued EmitEventJob (Job ID: d3e014ae-fe20-4916-8da8-e69066e3fd5b) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborting\",\"updated_at\":\"2015-12-04T14:58:41.428Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborting\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":false,\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.430Z\"}}"}
1468235
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468236
+  (0.0ms) SAVEPOINT active_record_1
1468237
+ SQL (0.1ms) INSERT INTO "output_chunks" ("text", "task_id", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["text", "\nAbort: sending SIGTERM to pid 42\n"], ["task_id", 644540443], ["created_at", "2015-12-04 14:58:41.439643"], ["updated_at", "2015-12-04 14:58:41.439643"]]
1468238
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1468239
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback') AND "tasks"."stack_id" = ? [["stack_id", 616453971]]
1468240
+  (0.0ms) SAVEPOINT active_record_1
1468241
+ SQL (0.1ms) UPDATE "tasks" SET "status" = ?, "updated_at" = ? WHERE "tasks"."id" = ? [["status", "aborted"], ["updated_at", "2015-12-04 14:58:41.443154"], ["id", 644540443]]
1468242
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.444196' WHERE "stacks"."id" = ? [["id", 616453971]]
1468243
+ Commit Load (0.0ms) SELECT "commits".* FROM "commits" WHERE "commits"."id" = ? LIMIT 1 [["id", 3]]
1468244
+ Stack Load (0.0ms) SELECT "stacks".* FROM "stacks" WHERE "stacks"."id" = ? LIMIT 1 [["id", 616453971]]
1468245
+ Commit Load (0.1ms) SELECT "commits".* FROM "commits" WHERE "commits"."stack_id" = ? AND "commits"."detached" = 'f' AND (id > 3) AND (id <= 4) ORDER BY "commits"."id" ASC [["stack_id", 616453971]]
1468246
+ SQL (0.1ms) INSERT INTO "tasks" ("type", "user_id", "stack_id", "parent_id", "since_commit_id", "until_commit_id", "created_at", "updated_at", "additions", "deletions") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["type", "Rollback"], ["user_id", 1047960473], ["stack_id", 616453971], ["parent_id", 644540443], ["since_commit_id", 4], ["until_commit_id", 3], ["created_at", "2015-12-04 14:58:41.446419"], ["updated_at", "2015-12-04 14:58:41.446419"], ["additions", 420], ["deletions", 342]]
1468247
+ SQL (0.1ms) UPDATE "stacks" SET "tasks_count" = COALESCE("tasks_count", 0) + 1 WHERE "stacks"."id" = ? [["id", 616453971]]
1468248
+ SQL (0.1ms) UPDATE "stacks" SET "updated_at" = '2015-12-04 14:58:41.449663' WHERE "stacks"."id" = ? [["id", 616453971]]
1468249
+ [ActiveJob] Enqueued PerformTaskJob (Job ID: 78dfde9d-e836-4d5f-b6d9-4642f902c943) to Test(deploys) with arguments: gid://shipit/Rollback/783434609
1468250
+ Stack Exists (0.1ms) SELECT 1 AS one FROM "stacks" WHERE ("stacks"."repo_name" = 'shipit-engine' AND "stacks"."id" != 616453971 AND "stacks"."repo_owner" = 'shopify' AND "stacks"."environment" = 'production') LIMIT 1
1468251
+ SQL (0.1ms) UPDATE "stacks" SET "cached_deploy_spec" = ?, "lock_reason" = ?, "lock_author_id" = ?, "updated_at" = ? WHERE "stacks"."id" = ? [["cached_deploy_spec", "{\"machine\":{\"environment\":{}},\"review\":{\"checklist\":[\"foo\",\"bar\",\"baz\"],\"monitoring\":[{\"image\":\"https://example.com/monitor.png\",\"width\":200,\"height\":300}]},\"dependencies\":{\"override\":[]},\"deploy\":{\"override\":null,\"variables\":[{\"name\":\"SAFETY_DISABLED\",\"title\":\"Set to 1 to do dangerous things\",\"default\":0}]},\"rollback\":{\"override\":[\"echo 'Rollback!'\"]},\"fetch\":[\"echo '42'\"],\"tasks\":{\"restart\":{\"action\":\"Restart application\",\"description\":\"Restart app and job servers\",\"steps\":[\"cap $ENVIRONMENT deploy:restart\"]}},\"ci\":{\"hide\":[\"ci/hidden\"],\"allow_failures\":[\"ci/ok_to_fail\"]}}"], ["lock_reason", "A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again."], ["lock_author_id", 1047960473], ["updated_at", "2015-12-04 14:58:41.451983"], ["id", 616453971]]
1468252
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1047960473]]
1468253
+ [ActiveJob] Enqueued EmitEventJob (Job ID: bde674fb-365a-4d15-83ad-81a0dca34cb0) to Test(hooks) with arguments: {:event=>"deploy", :stack_id=>616453971, :payload=>"{\"deploy\":{\"id\":644540443,\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production/deploys/644540443\",\"output_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks/644540443/output\",\"type\":\"deploy\",\"status\":\"aborted\",\"updated_at\":\"2015-12-04T14:58:41.443Z\",\"created_at\":\"2015-12-04T14:03:40.000Z\",\"additions\":420,\"deletions\":342,\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"revision\":{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\"},\"commits\":[{\"sha\":\"467578b362bf2b4df5903e1c7960929361c3435a\",\"message\":\"#yoloshipit!\",\"additions\":420,\"deletions\":342,\"authored_at\":\"2015-11-30T14:58:40.000Z\",\"committed_at\":\"2015-12-01T14:58:40.000Z\",\"author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"},\"committer\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}]},\"status\":\"aborted\",\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.451Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}}"}
1468254
+ [ActiveJob] Enqueued EmitEventJob (Job ID: 696afc26-ce63-450a-bbcc-9d23f0cfe63d) to Test(hooks) with arguments: {:event=>"lock", :stack_id=>616453971, :payload=>"{\"locked\":true,\"stack\":{\"id\":616453971,\"repo_owner\":\"shopify\",\"repo_name\":\"shipit-engine\",\"environment\":\"production\",\"html_url\":\"http://shipit.com/shopify/shipit-engine/production\",\"url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production\",\"tasks_url\":\"http://shipit.com/api/stacks/shopify/shipit-engine/production/tasks\",\"undeployed_commits_count\":1,\"is_locked\":true,\"lock_reason\":\"A rollback for 467578b362bf2b4df5903e1c7960929361c3435a has been triggered. Please make sure the reason for the rollback has been addressed before deploying again.\",\"continuous_deployment\":false,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:41.451Z\",\"lock_author\":{\"id\":1047960473,\"name\":\"Lando Walrussian\",\"email\":\"walrus@shopify.com\",\"login\":\"walrus\",\"avatar_url\":null,\"created_at\":\"2015-12-04T14:58:40.000Z\",\"updated_at\":\"2015-12-04T14:58:40.000Z\"}}}"}
1468255
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1468256
+  (0.1ms) SELECT COUNT(*) FROM "tasks" WHERE "tasks"."type" IN ('Rollback') AND "tasks"."stack_id" = ? [["stack_id", 616453971]]
1468257
+ [Redis] command=FLUSHDB args=
1468258
+ [Redis] call_time=0.18 ms
1468259
+  (0.9ms) rollback transaction