aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-09-20 13:36:42 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-09-20 13:36:42 +0100
commitebc2e1f227471ecaccd16eb897da27c193eddb65 (patch)
treeb5346b879ce6033179bab224b3bb6a13a97bf1a0
parent791b23f8610b4a616ac0899995c96231b8e8e633 (diff)
parentfd34ae20e8e825600838cce79781a8c8b592b35a (diff)
Merge branch 'fix-parallel-test-run'
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/State.pm5
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;