Unit Testing ZFW

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Unit Testing ZFW

Ryan Chan-2
Today I have downloaded 1.9. ZFW.

I want to test its by running...

 php -f AllTests.php

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 7680 bytes)
in /home/ZendFramework/tests/Zend/Config/Writer/XmlTest.php on
line 54

I have checked my php.ini - memory limit is 32M.

Even I increased the value to 1GB, memory exhausted still exist,
anything I missed?


Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

Tim Fountain
2009/8/3 Ryan Chan <[hidden email]>

 php -f AllTests.php

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 7680 bytes)
in /home/ZendFramework/tests/Zend/Config/Writer/XmlTest.php on
line 54

I have checked my php.ini - memory limit is 32M.

Even I increased the value to 1GB, memory exhausted still exist,
anything I missed?

When you increased the memory limit, did the error above change to "Allowed memory size of  1073741824 bytes exhausted..."? If not, remember that the command line version of PHP has its own php.ini file, so make sure you're editing the correct one.

--
Tim Fountain
http://tfountain.co.uk/
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

padraicb
For example, under Ubuntu there is
/etc/php5/cli/php.ini and /etc/php5/apache2/php.ini
 
Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative



From: Tim Fountain <[hidden email]>
To: [hidden email]
Sent: Monday, August 3, 2009 3:08:29 PM
Subject: Re: [fw-general] Unit Testing ZFW

2009/8/3 Ryan Chan <[hidden email]>

 php -f AllTests.php

Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 7680 bytes)
in /home/ZendFramework/tests/Zend/Config/Writer/XmlTest.php on
line 54

I have checked my php.ini - memory limit is 32M.

Even I increased the value to 1GB, memory exhausted still exist,
anything I missed?

When you increased the memory limit, did the error above change to "Allowed memory size of  1073741824 bytes exhausted..."? If not, remember that the command line version of PHP has its own php.ini file, so make sure you're editing the correct one.

--
Tim Fountain
http://tfountain.co.uk/
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

Ralph Schindler-2
FWIW, on the command line, the best way I think to find out where your
php is expecting an ini file is:


/etc# php -i | grep -i "configuration"

Configuration File (php.ini) Path => /etc
Loaded Configuration File => /private/etc/php-cli.ini


-ralph


Pádraic Brady wrote:

> For example, under Ubuntu there is
> /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini
>  
> Pádraic Brady
>
> http://blog.astrumfutura.com
> http://www.survivethedeepend.com
> OpenID Europe Foundation Irish Representative <http://www.openideurope.eu/>
>
>
> ------------------------------------------------------------------------
> *From:* Tim Fountain <[hidden email]>
> *To:* [hidden email]
> *Sent:* Monday, August 3, 2009 3:08:29 PM
> *Subject:* Re: [fw-general] Unit Testing ZFW
>
> 2009/8/3 Ryan Chan <[hidden email] <mailto:[hidden email]>>
>
>
>      php -f AllTests.php
>
>     Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
>     allocate 7680 bytes)
>     in /home/ZendFramework/tests/Zend/Config/Writer/XmlTest.php on
>     line 54
>
>     I have checked my php.ini - memory limit is 32M.
>
>     Even I increased the value to 1GB, memory exhausted still exist,
>     anything I missed?
>
>
> When you increased the memory limit, did the error above change to
> "Allowed memory size of  1073741824 bytes exhausted..."? If not,
> remember that the command line version of PHP has its own php.ini file,
> so make sure you're editing the correct one.
>
> --
> Tim Fountain
> http://tfountain.co.uk/
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

Ryan Chan-2
In reply to this post by Tim Fountain
Hello,

On Mon, Aug 3, 2009 at 10:08 PM, Tim Fountain<[hidden email]> wrote:
> When you increased the memory limit, did the error above change to "Allowed
> memory size of  1073741824 bytes exhausted..."? If not, remember that the
> command line version of PHP has its own php.ini file, so make sure you're
> editing the correct one.
>
> --


Yes, when memory is increased to 1GB, then it will die at another place.

I have verified my memory setting using php -i | grep memory


Anyone can run the unit test successfully?
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

Ralph Schindler-2
Are you testing trunk?

Are you using the standard TestConfiguration.php.dist file?

Are you enabling any exotic components that are disabled by default?

Where is it dying?  I would try commenting out the test run for the
larger components first (Zend_Pdf, Zend_Memory, Zend_Search) to see if
that affects the runtime.  To do this, comment out the top level
component in Zend_AllTests.

Once you find the root cause, we'll have to see if its a system specific
issue.  I don't currently have any issues with running the default tests
in under 384 megs.  And I am using PHP 5.2.10.

-ralph

Ryan Chan wrote:

> Hello,
>
> On Mon, Aug 3, 2009 at 10:08 PM, Tim Fountain<[hidden email]> wrote:
>> When you increased the memory limit, did the error above change to "Allowed
>> memory size of  1073741824 bytes exhausted..."? If not, remember that the
>> command line version of PHP has its own php.ini file, so make sure you're
>> editing the correct one.
>>
>> --
>
>
> Yes, when memory is increased to 1GB, then it will die at another place.
>
> I have verified my memory setting using php -i | grep memory
>
>
> Anyone can run the unit test successfully?
>
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

weierophinney
Administrator
-- Ralph Schindler <[hidden email]> wrote
(on Tuesday, 11 August 2009, 11:36 AM -0500):
> Are you testing trunk?
>
> Are you using the standard TestConfiguration.php.dist file?
>
> Are you enabling any exotic components that are disabled by default?
>
> Where is it dying?  

One way to find this out, btw, is to run phpunit with the --tap switch.
This will produce a line of output for each test run -- and thus you'll
know what test was run immediately prior to the process dying. We used
this extensively when preparing for 1.9.0 to identify problematic test
suites.

As Ralph noted, we have been running the suite regularly, on what is
basically stock hardware and a stock PHP install.

One extension that I *know* is problematic when running the entire suite
is XDebug. Because of all the profiling information it tracks, it can
often use substantially more memory and run into circular references
that don't occur under normal PHP usage -- causing the suite to crash.
(Which sucks, because it'd be really, really nice to get a full coverage
report of the entire test suite at some point. (-: ) Enable XDebug only
when trying to profile individual component test suites within ZF.

> I would try commenting out the test run for the  larger components
> first (Zend_Pdf, Zend_Memory, Zend_Search) to see if  that affects the
> runtime.  To do this, comment out the top level  component in
> Zend_AllTests.
>
> Once you find the root cause, we'll have to see if its a system specific  
> issue.  I don't currently have any issues with running the default tests  
> in under 384 megs.  And I am using PHP 5.2.10.
>
> -ralph
>
> Ryan Chan wrote:
>> Hello,
>>
>> On Mon, Aug 3, 2009 at 10:08 PM, Tim Fountain<[hidden email]> wrote:
>>> When you increased the memory limit, did the error above change to "Allowed
>>> memory size of  1073741824 bytes exhausted..."? If not, remember that the
>>> command line version of PHP has its own php.ini file, so make sure you're
>>> editing the correct one.
>>>
>>> --
>>
>>
>> Yes, when memory is increased to 1GB, then it will die at another place.
>>
>> I have verified my memory setting using php -i | grep memory
>>
>>
>> Anyone can run the unit test successfully?
>>
>

--
Matthew Weier O'Phinney
Project Lead            | [hidden email]
Zend Framework          | http://framework.zend.com/
Reply | Threaded
Open this post in threaded view
|

Re: Unit Testing ZFW

Benjamin Eberlei-2
hello matthew,

i have been able to generate a whole coverage report on the test-suite with
xdebug and php memory set to 2-3gb.

greetings

On Sunday 16 August 2009 11:16:32 pm Matthew Weier O'Phinney wrote:

> -- Ralph Schindler <[hidden email]> wrote
>
> (on Tuesday, 11 August 2009, 11:36 AM -0500):
> > Are you testing trunk?
> >
> > Are you using the standard TestConfiguration.php.dist file?
> >
> > Are you enabling any exotic components that are disabled by default?
> >
> > Where is it dying?
>
> One way to find this out, btw, is to run phpunit with the --tap switch.
> This will produce a line of output for each test run -- and thus you'll
> know what test was run immediately prior to the process dying. We used
> this extensively when preparing for 1.9.0 to identify problematic test
> suites.
>
> As Ralph noted, we have been running the suite regularly, on what is
> basically stock hardware and a stock PHP install.
>
> One extension that I *know* is problematic when running the entire suite
> is XDebug. Because of all the profiling information it tracks, it can
> often use substantially more memory and run into circular references
> that don't occur under normal PHP usage -- causing the suite to crash.
> (Which sucks, because it'd be really, really nice to get a full coverage
> report of the entire test suite at some point. (-: ) Enable XDebug only
> when trying to profile individual component test suites within ZF.
>
> > I would try commenting out the test run for the  larger components
> > first (Zend_Pdf, Zend_Memory, Zend_Search) to see if  that affects the
> > runtime.  To do this, comment out the top level  component in
> > Zend_AllTests.
> >
> > Once you find the root cause, we'll have to see if its a system specific
> > issue.  I don't currently have any issues with running the default tests
> > in under 384 megs.  And I am using PHP 5.2.10.
> >
> > -ralph
> >
> > Ryan Chan wrote:
> >> Hello,
> >>
> >> On Mon, Aug 3, 2009 at 10:08 PM, Tim Fountain<[hidden email]>
wrote:

> >>> When you increased the memory limit, did the error above change to
> >>> "Allowed memory size of  1073741824 bytes exhausted..."? If not,
> >>> remember that the command line version of PHP has its own php.ini file,
> >>> so make sure you're editing the correct one.
> >>>
> >>> --
> >>
> >> Yes, when memory is increased to 1GB, then it will die at another place.
> >>
> >> I have verified my memory setting using php -i | grep memory
> >>
> >>
> >> Anyone can run the unit test successfully?


--
Benjamin Eberlei
http://www.beberlei.de