Thanks for your thoughts Greg
I have created unit tests for the sole purpose of attempting to catch
developers
a) Making database modifications e.g. creating triggers, indexes, which
would slow the creation of say invoices down by an unacceptable margin e.g.
20%. I could quite easily imagine a developer creating a complex trigger and
inadvertently not thinking about creation time.
b) Making code modifications to the say invoice business object to add a
complex business rule which slowed creation down by 50%.
Obviously if an existing client is getting 10000 invoices imported in a 1
hour time window and they only have 1 hour 20 minutes say, if a patch was
applied was increased this to 1 hours 30 minutes they may have a serious
issue.
By adding the performance test of creating x documents in y seconds I have
tried to encompass a test which would break the cruise control build if the
performance went to an unacceptable margin. I appreciate each machine will
have a completely different time which is why I made the timings
configurable e.g. the config file of the unit test assembly has entries
<add key="SP_PERF_PO_1-MaxTimeMs" value="400" />
<add key="SP_PERF_PO_2-MaxTimeMs" value="600" />
This file will be managed in VSS so if any developers have to increase the
time to get it to pass on our build server, we have full history of this.
The unit tests create a large selection of docs e.g. 1000 so should see any
inconsistensies in times.
I am therefore hoping the various raises of elevating process / thread
priority here would help bring about a bit more consistency to my results
and ensure the unit tests don't fail unexpectedly because of other factors
on the machine.
Thoughts?
> Boosting your priority will work (I believe through all of those means)
> but there will still be things that take priority over you (such as device
[quoted text clipped - 47 lines]
>>
>> Thoughts?
Greg Young - 02 Jul 2006 18:41 GMT
This will kill your developer performance to have developers running these
tests. Let's say your average test takes 3 seconds and you have 100
performance tests ... your unit tests will now take 5 minutes to run this
obviously kills your cycle time. The result is that developers will not run
the tests.
Running tests like these is a fairly controlled environment (i.e. running
nightly on your CI server) makes alot more sense.
You bring up another point that makes things difficult in that you are also
integrating with other processes (whatever SQL Server you happen to be
using). Is this server running on the same machine (if not you are likely
testing network latency). What about the load of this server during ther
testing period (i.e. scheduled jobs).
The way I do this is I have a set of performance tests which are run on an
integration server (my integration server does almost nothing at night, i.e.
scheduled jobs etc so it is a good place to run tests). I have thresholds
setup for an allowable delta due to outside variables. If this threshold is
crossed it will generate an error report.
Cheers,
Greg
> Thanks for your thoughts Greg
>
[quoted text clipped - 86 lines]
>>>
>>> Thoughts?
Matt Adamson - 02 Jul 2006 22:34 GMT
All unit tests are forced to be run by the CI server ( Cruise Control .NET )
and taking an extra 5 minutes or so to run additional performance is not an
issue for us. I would rather spend the 5 minutes rather than risk getting
slower performant code released to our clients.
However currently our unit tests are executed after any code changes are
detected in VSS. In light of what you say though I think it would be better
to schedule these tests to not run on every build but only at a scheduled
time e.g. 1 in the morning. As the server is used by others for a source
control repository, it can be utilised at random times.
I appreciate your thoughts however you haven't answered my question on the
way to boost the priority of processes using the 3 methods mentioned, or are
you saying you should never do this?
Cheers
Matt
> This will kill your developer performance to have developers running these
> tests. Let's say your average test takes 3 seconds and you have 100
[quoted text clipped - 113 lines]
>>>>
>>>> Thoughts?
Greg Young - 02 Jul 2006 23:22 GMT
I am saying you probably shouldn't do this but that I believe all mechanisms
would work (the thread priority probably being the best method as you can
spawn the tests on a new thread and only grant that thread higher priority).
The problem with boosting your priority is that there are still things at a
higher priority so it is only one step towards making things more
deterministic.
Cheers,
Greg
> All unit tests are forced to be run by the CI server ( Cruise Control
> .NET ) and taking an extra 5 minutes or so to run additional performance
[quoted text clipped - 132 lines]
>>>>>
>>>>> Thoughts?