The default configuration Aegir employs for nginx enables the Boost / FastCGI cache for GET requests, but this can cause SimpleTest test cases to fail unexpectedly if data has been changed by a test in the database.

Either the configuration should exclude requests that have a SimpleTest user agent (e.g. simpletest678768;1497219829;593dc2f536ab06.40940043;XOSIPFrFCQ67YGX5ZLoW7-AB1-jw6qR0Y_yK7Lv062E), or SimpleTest should force all requests to send a no-cache header. My preference would be for the nginx config to handle this, so we don't break header tests (i.e. tests that are explicitly designed to verify that the correct caching headers are being sent for certain requests).

Comments

GuyPaddock created an issue.

GuyPaddock’s picture

As a fix, I've modified the start of the location @cache directive in my includes/nginx_vhost_common.conf as follows:

location @cache {
  # 2885292 - Disable Boost cache to prevent inconsistent test results
  if ($http_user_agent ~ simpletest ) {
    set $nocache_details "Skip";
    return 405;
  }
  ... lines omitted ...
}

This seems to prevent caching of SimpleTest requests.

GuyPaddock’s picture

It's also worth noting that enabling xdebug and starting a debug session will also seem to disable boost caching of the requests. If anyone else is scratching their head as to why their SimpleTest web test case is failing when xdebug is disabled but succeeding when its enabled, and they're using FastCGI / Boost caching, this is why.