-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random failure in "Field translations tests": The configuration file "language.settings" could not be read. #511
Comments
I had the The configuration file "flickr.settings" could not be read. error probably due to a syntax error in my flickr.settings.json file on install. Even correcting it with any sequence of uninstall/install didn't help until I restarted the server with: That seems to have done the trick. It looks that it was a code error that leaves some traces even after correcting it. |
Although I think we already attempt to clear the PHP file cache, perhaps we're not getting it in all situations where config is updated: http://php.net/manual/en/function.clearstatcache.php |
After a recent fix to the error reporting, the error now accurately states the real problem:
I found a similar error today in
The cause of this seems to be that these tests use |
I think I've got the solution here. The problem is caused by our PHP 5.3 compatibility for unescaped unicode characters. We're using a solution such as proposed at http://stackoverflow.com/questions/2934563/how-to-decode-unicode-escape-sequences-like-u00ed-to-proper-utf-8-encoded-cha for unescaping unicode characters. However, the problem we're having is that character combinations that are not intended to be considered Unicode characters are getting unescaped. For example, the string So the solution is pretty simple. We just need to check for a backlash preceding a For testing this problem, I set up a script to use random characters (same as define('BACKDROP_ROOT', getcwd());
require_once BACKDROP_ROOT . '/core/includes/bootstrap.inc';
backdrop_bootstrap(BACKDROP_BOOTSTRAP_FULL);
function my_random_string($length = 8) {
$str = '';
$character_string = '';
for ($i = 0; $i < $length; $i++) {
$character = mt_rand(32, 126);
$str .= chr($character);
$character_string .= $character . ' ';
}
return $character_string . $str;
}
for ($n = 0; $n < 100000; $n++) {
$value = my_random_string(20);
$config = config('test.settings');
$config->set('key', $value);
$config->save();
$config = config('test.settings');
$config->get('key');
} Once an invalid string was encountered, Backdrop would throw an exception and stop. Some times I had to run it a few times before such an error occurred. |
🆒 Very clever! |
PR at backdrop/backdrop#1164. This got a little messier than I hoped because checking for a preceding backslash before a Unicode character may match another Unicode character before the current one, so the replacement has to be done twice.
Not a deal breaker but just not very elegant. I also expanded test coverage, as we have been bitten by impartial test coverage in this instance. There was even a line in the tests:
Heh. Well now we've both fixed support for Unicode characters and added the missing tests. |
Merged backdrop/backdrop#1164 into 1.x and 1.2.x. It'll be so nice to have a lot fewer random test failures. |
Fail report for this issue:
Contents:
|
One more here: https://zen.ci/backdrop/backdrop/test/test-php53-backdrop_backdrop_1444-7301
|
I did not notice that issue closed. |
I'm not sure how an old issue form 2017 ended up in the 1.12.7 milestone but this one looks to have been fixed. @Gormartsen if you are still seeing issues "not properly formatted JSON." can you please open a new issue? |
When running tests, we're currently getting this report fairly frequently from Travis CI, about once every 4-5 runs:
This doesn't seem to happen locally running tests through the UI. Command-line tests have not yet been confirmed nor disproven. This is a spin-off from the PR at backdrop/backdrop#612
The text was updated successfully, but these errors were encountered: