diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-09-20 13:36:42 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-09-20 13:36:42 +0100 |
commit | ebc2e1f227471ecaccd16eb897da27c193eddb65 (patch) | |
tree | b5346b879ce6033179bab224b3bb6a13a97bf1a0 | |
parent | 791b23f8610b4a616ac0899995c96231b8e8e633 (diff) | |
parent | fd34ae20e8e825600838cce79781a8c8b592b35a (diff) |
Merge branch 'fix-parallel-test-run'
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/State.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/State.pm b/perllib/FixMyStreet/DB/ResultSet/State.pm index ac13ec2a4..de56c738c 100644 --- a/perllib/FixMyStreet/DB/ResultSet/State.pm +++ b/perllib/FixMyStreet/DB/ResultSet/State.pm @@ -24,7 +24,10 @@ sub states { my $rs = shift; my $states = Memcached::get('states'); - if ($states) { + # If tests are run in parallel, the cached state in Memcached could be + # corrupted by multiple tests changing it at the same time + # uncoverable branch true + if ($states && !FixMyStreet->test_mode) { # Need to reattach schema $states->[0]->result_source->schema( $rs->result_source->schema ) if $states->[0]; return $states; |