Re: Long tests

2016-10-28 Thread Katherine Cox-Buday
Nate Finch  writes:

Thanks for highlighting these, Nate!

> Here's some especially bad low hanging fruit (note these are the times
> for single tests, not full suites):

If anyone is so inclined, I have modified the deploy command so that it is unit 
testable, and written some unit tests[1] for it to help guide future 
development; they are 100% in-memory (aside from some suite set up which likely 
doesn't need to be there). If you have some free time (ha!), take one of the 
tests from `DeploySuite` and convert it over to a true in-memory unit test.

[1] - 
https://github.com/juju/juju/blob/staging/cmd/juju/application/deploy_test.go#L1243

-- 
Katherine

-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev


Re: Long tests

2016-10-28 Thread roger peppe
Thanks for looking at this long standing issue.

If you really want to speed up the tests, I believe the most fruitful
place is to work on speeding up JujuConnSuite.SetUpTest
I'm pretty sure it does a bunch of stuff (e.g. creating a fake juju home
directory) that aren't required by 95% of tests.

A while ago when I was wondering where the tests were spending their
time, I wrote a little program to analyse gocheck output.

http://paste.ubuntu.com/23391608/

If you run all the tests with:

 go test -p 1 -v -timeout 60m github.com/juju/juju/... -check.vv
2>&1 | timestamp > /home/rog/tmp/juju-all-test-3> /tmp/test.out

where timestamp is github.com/rogpeppe/misc/cmd/timestamp,
then the above program will gather info into the "whole"
struct, which makes it reasonably straightforward
to analyse the data in various ad hoc ways (the stuff
that it prints now is just an example - it's designed to
be tweaked).

This is what it printed when I ran it on current juju tip:

total suites 1297
total test time 32m7.55s
total suite time 41m38.693s
total setup test 13m13.757s
total teardown test 42.846s
total setup suite 11.639s
total teardown suite 9m32.999s
total fixture overhead 23m41.241s
longest test 57.089s ( BakeryStorageSuite.TestExpiryTime) setup 0s teardown 0s
overall time 41m49.02s

That is, fixture overhead accounts for more than half the time
that our tests take to run.

  cheers,
rog.

On 28 October 2016 at 04:31, Nate Finch  wrote:
> I ran the tests serially today to try to get a picture of what tests
> actually take a long time without worrying about contention.  The full run
> took almost 45 minutes (normally it takes like 15 testing packages in
> parallel).
>
> Here's the full output (sorry for the google drive link, pastebin got mad at
> the length):
> https://drive.google.com/file/d/0B-r4AW1RoHJNR3plVjhwSVM1Z0E/view
>
> Unfortunately, the state tests panicked after a 10 minute timeout, but
> there's still some good info in there.
>
> Here's some especially bad low hanging fruit (note these are the times for
> single tests, not full suites):
>
> PASS: showoutput_test.go:59: ShowOutputSuite.TestRun 18.007s
> PASS: upgradejuju_test.go:307: UpgradeJujuSuite.TestUpgradeJuju 10.722s
> PASS: status_test.go:3292: StatusSuite.TestStatusAllFormats 12.255s
> PASS: unit_test.go:217: UnitSuite.TestUpgradeFailsWithoutTools 10.200s
> PASS: syslog_test.go:220: syslogSuite.TestConfigChange 31.715s
> PASS: syslog_test.go:193: syslogSuite.TestLogRecordForwarded 31.731s
> PASS: bakerystorage_test.go:72: BakeryStorageSuite.TestExpiryTime 58.037s
> PASS: local_test.go:547:
> localServerSuite.TestStopInstanceSecurityGroupNotDeleted 29.046s
> PASS: kvm-broker_test.go:329:
> kvmProvisionerSuite.TestContainerStartedAndStopped 10.098s
> PASS: worker_test.go:69:
> statusHistoryPrunerSuite.TestWorkerWontCallPruneBeforeFiringTimer 10.000s
> PASS: uniter_test.go:1190: UniterSuite.TestActionEvents 39.242s
> PASS: uniter_test.go:977: UniterSuite.TestUniterRelations 14.132s
>
> There's about 112 tests that are faster than these, but still take more than
> a second to run, shown here: http://pastebin.ubuntu.com/23391234/
>
> -Nate
>
>
> --
> Juju-dev mailing list
> Juju-dev@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>

-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev


Long tests

2016-10-27 Thread Nate Finch
I ran the tests serially today to try to get a picture of what tests
actually take a long time without worrying about contention.  The full run
took almost 45 minutes (normally it takes like 15 testing packages in
parallel).

Here's the full output (sorry for the google drive link, pastebin got mad
at the length):
https://drive.google.com/file/d/0B-r4AW1RoHJNR3plVjhwSVM1Z0E/view

Unfortunately, the state tests panicked after a 10 minute timeout, but
there's still some good info in there.

Here's some especially bad low hanging fruit (note these are the times for
single tests, not full suites):

PASS: showoutput_test.go:59: ShowOutputSuite.TestRun 18.007s
PASS: upgradejuju_test.go:307: UpgradeJujuSuite.TestUpgradeJuju 10.722s
PASS: status_test.go:3292: StatusSuite.TestStatusAllFormats 12.255s
PASS: unit_test.go:217: UnitSuite.TestUpgradeFailsWithoutTools 10.200s
PASS: syslog_test.go:220: syslogSuite.TestConfigChange 31.715s
PASS: syslog_test.go:193: syslogSuite.TestLogRecordForwarded 31.731s
PASS: bakerystorage_test.go:72: BakeryStorageSuite.TestExpiryTime 58.037s
PASS: local_test.go:547:
localServerSuite.TestStopInstanceSecurityGroupNotDeleted 29.046s
PASS: kvm-broker_test.go:329:
kvmProvisionerSuite.TestContainerStartedAndStopped 10.098s
PASS: worker_test.go:69:
statusHistoryPrunerSuite.TestWorkerWontCallPruneBeforeFiringTimer 10.000s
PASS: uniter_test.go:1190: UniterSuite.TestActionEvents 39.242s
PASS: uniter_test.go:977: UniterSuite.TestUniterRelations 14.132s

There's about 112 tests that are faster than these, but still take more
than a second to run, shown here: http://pastebin.ubuntu.com/23391234/

-Nate
-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev