Closed byroot closed 9 years ago
Do you have the seed?
No I don't for some reason it's not printed out. That would be the first thing to fix.
Nevermind: Run options: --seed 8804
Ok, so it appear that it isn't order dependent (I retried previously failed builds with the same seed and they passed).
So this feels like a huge rabbit hole I'll let on the side for now.
So this seems to be due to the fact that Rollbacks
are loaded the Deploys
count, but only AFTER Rollbacks have been loaded in the first place (obv).
> s = Stack.first
> s.deploys.count
# (3.0ms) SELECT COUNT(*) FROM `tasks` WHERE `tasks`.`type` IN ('Deploy') AND `tasks`.`stack_id`
> s.rollbacks
# Rollback Load (0.7ms) SELECT `tasks`.* FROM `tasks` WHERE `tasks`.`type` IN ('Rollback') AND `tasks`.`stack_id` = 3
> s.deploys.count
# (0.9ms) SELECT COUNT(*) FROM `tasks` WHERE `tasks`.`type` IN ('Deploy') AND `tasks`.`stack_id`
> s.deploys(true).count
# Deploy Load (0.8ms) SELECT `tasks`.* FROM `tasks` WHERE `tasks`.`type` IN ('Deploy', 'Rollback') AND `tasks`.`stack_id` = 3
# (0.5ms) SELECT COUNT(*) FROM `tasks` WHERE `tasks`.`type` IN ('Deploy', 'Rollback') AND `tasks`.`stack_id` = 3
Obvious fix for tests is to eagerload models, but this means that dev could have discrepancies
Nice catch. require_dependency
should fix it no?
In Stack
? yes
We must have a leaky test or something, I noticed a couple unexplained and intermittent test failures:
and