Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
ad2a66de
Commit
ad2a66de
authored
Feb 10, 2015
by
Nathaniel Catchpole
Browse files
Issue
#2422745
by alexpott: Reduce simpletest memory limit
parent
4cd30ead
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/simpletest/simpletest.install
View file @
ad2a66de
...
...
@@ -15,7 +15,7 @@
* https://www.drupal.org/node/2289201 and
* https://www.drupal.org/node/2307163 and then decrease this limit.
*/
const
SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT
=
'
320
M'
;
const
SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT
=
'
192
M'
;
/**
* Implements hook_requirements().
...
...
core/scripts/run-tests.sh
View file @
ad2a66de
...
...
@@ -522,13 +522,6 @@ function simpletest_script_execute_batch($test_classes) {
$test_ids
[]
=
$test_id
;
$test_class
=
array_shift
(
$test_classes
)
;
// Process phpunit tests immediately since they are fast and we don
't need
// to fork for them.
if (is_subclass_of($test_class, '
\P
HPUnit_Framework_TestCase
')) {
simpletest_script_run_phpunit($test_id, $test_class);
continue;
}
// Fork a child process.
$command
=
simpletest_script_command
(
$test_id
,
$test_class
)
;
$process
=
proc_open
(
$command
, array
()
,
$pipes
, NULL, NULL, array
(
'bypass_shell'
=>
TRUE
))
;
...
...
@@ -637,11 +630,15 @@ function simpletest_script_run_one_test($test_id, $test_class) {
$methods
=
array
()
;
}
$test
=
new
$class_name
(
$test_id
)
;
$test
->dieOnFail
=
(
bool
)
$args
[
'die-on-fail'
]
;
$test
->verbose
=
(
bool
)
$args
[
'verbose'
]
;
$test
->run
(
$methods
)
;
simpletest_script_reporter_display_summary
(
$test_class
,
$test
->results
)
;
if
(
is_subclass_of
(
$test_class
,
'\PHPUnit_Framework_TestCase'
))
{
simpletest_script_run_phpunit
(
$test_id
,
$test_class
)
;
}
else
{
$test
->dieOnFail
=
(
bool
)
$args
[
'die-on-fail'
]
;
$test
->verbose
=
(
bool
)
$args
[
'verbose'
]
;
$test
->run
(
$methods
)
;
simpletest_script_reporter_display_summary
(
$test_class
,
$test
->results
)
;
}
// Finished,
kill
this runner.
exit
(
0
)
;
...
...
@@ -707,6 +704,10 @@ function simpletest_script_command($test_id, $test_class) {
*
@see simpletest_script_run_one_test
()
*
/
function
simpletest_script_cleanup
(
$test_id
,
$test_class
,
$exitcode
)
{
if
(
strpos
(
$test_class
,
'Drupal\\Tests\\'
)
===
0
)
{
// PHPUnit
test
, move on.
return
;
}
// Retrieve the last database prefix used
for
testing.
list
(
$db_prefix
,
)
=
simpletest_last_test_get
(
$test_id
)
;
...
...
core/tests/Drupal/Tests/Component/PhpStorage/MTimeProtectedFileStorageBase.php
View file @
ad2a66de
...
...
@@ -38,11 +38,12 @@ abstract class MTimeProtectedFileStorageBase extends PhpStorageTestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
directory
=
sys_get_temp_dir
()
.
'/php'
.
str_replace
(
'\\'
,
'_'
,
get_class
(
$this
));
$this
->
secret
=
$this
->
randomMachineName
();
$this
->
settings
=
array
(
'directory'
=>
sys_get_temp_dir
()
.
'/php'
,
'directory'
=>
$this
->
directory
,
'bin'
=>
'test'
,
'secret'
=>
$this
->
secret
,
);
...
...
@@ -69,7 +70,7 @@ public function testSecurity() {
$php
=
new
$this
->
storageClass
(
$this
->
settings
);
$name
=
'simpletest.php'
;
$php
->
save
(
$name
,
'<?php'
);
$expected_root_directory
=
sys_get_temp_dir
()
.
'/php
/test'
;
$expected_root_directory
=
$this
->
directory
.
'
/test'
;
if
(
substr
(
$name
,
-
4
)
===
'.php'
)
{
$expected_directory
=
$expected_root_directory
.
'/'
.
substr
(
$name
,
0
,
-
4
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment