mkdir can fail in \Drupal\Core\Test\TestRunnerKernel::boot() because of a race condition
1 unresolved thread
Closes #3190859
Merge request reports
Activity
87 87 88 88 // Create the build/artifacts directory if necessary. 89 89 include_once $this->getAppRoot() . '/core/includes/file.inc'; 90 if (!is_dir('public://simpletest')) { 91 mkdir('public://simpletest', 0777, TRUE); 90 if (!is_dir('public://simpletest') && !@mkdir('public://simpletest', 0777, TRUE) && !is_dir('public://simpletest')) { 91 throw new \RuntimeException('Unable to create directory: public://simpletest'); TL;DR; I love to write clean-code and document all possible exceptions that could be thrown and it is useful to know by a developer.
Although, it is not common practice in Drupal core to document exceptions based on my experiences; and not just in test-related classes. This method can already throw several types of exceptions due to called methods, like
Settings
,parent:boot()
, etc. So I am skeptical about the benefit of adding a@throws
to the documentation. Do you think it would be still useful?
Please register or sign in to reply