Cannot run same loadtest many times on command line. Error : Could not access the load test results repository: Violation of PRIMARY KEY constraint 'PK__LoadTest__XXXXXXXXXXXX'. Cannot insert duplicate key in object 'dbo.LoadTestRunAgent'.
-
20 апреля 2012 г. 20:00
Hello,
I am in the process of automating loadtest of our service. I am using the same loadtest with a specific run settings over and over again. What is causing problem is, when I run the loadtest on command line using 'mstest' though helper classes, I am getting error : "Could not access the load test results repository: Violation of PRIMARY KEY constraint 'PK__LoadTest__XXXXXXXXXXXXX'. Cannot insert duplicate key in object 'dbo.LoadTestRunAgent'. "....I cleared the loadtest repository and run the test, runs fine for the first time. But after that gives the same error and gets aborted for all subsequent runs. I tried changing the Local.Settings but was of no help.
Can anyone help me on this issue? I appreciate your help!
Все ответы
-
23 апреля 2012 г. 7:11Модератор
Hi sjjj,
Thank you for posting in the MSDN forum.
I cleared the load test repository and run the test, runs fine for the first time. But after that gives the same error and gets aborted for all subsequent runs. I tried changing the Local.Settings but was of no help.
If you clean it again, does it work? Whether your tests take so high memory? As SQL Express, it has a 4 GB size limit Load testers, we often create a new repository and configure your load test to point to that database then try your load test again. Sometimes we also could clean up old load test results from the VSTS load test results store.
In addition, open the Manage Test Controller, and check the “local test result store”.
References:
http://blogs.msdn.com/b/billbar/archive/2006/02/09/528900.aspx.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
23 апреля 2012 г. 15:10
Hi Jack,
Thank you for the reply. Currently, I am using SQL express and it does work after cleaning the database again. My tests don't take up that much memory. And in long run (after successful automation) we don't want to create new databases or clean them. We want to create trend analysis reports over the time using the stored load test results. I am aware of the SQL express limits and thanks for the procedure to clean up the database :). I tried with cleaning the database just to see if I can reproduce the error.
Thanks again.
sonali joshi
-
24 апреля 2012 г. 2:08Модератор
You're welcome!
I tried with cleaning the database just to see if I can reproduce the error.
I look forward to hearing from you.
In addition, if possible, you could try to run it in another computer, and see whether it has the same issue.
Sincerely,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
25 апреля 2012 г. 17:38
Hi Jack,
I got the same error after cleaning the database and running the loadtest consecutively couple of times(no clean up in between). I tried running on another computer as you suggested but of no use. Interestingly, couple of times I got another error as shown below :
I have no clue why I got that error.
Just another thought : has it got anything to do with running many mstest processes? I am trying to understand the meaning of "This choice improves test run speed but increases risk to the MSTest.exe process." in '/noisolation' option of mstest.
I am running into these issues only when I run my unit test and a loadtest using mstest in C#.
Thanks again.
sonali joshi
- Изменено sjjj 25 апреля 2012 г. 17:40 added to clarify point
-
26 апреля 2012 г. 2:19Модератор
Hi sonali,
Glad to receive your reply.
Do you mean that you could run the test well within the VS IDE?
If so, could you share us the detailed steps when you run your test with the MSTest? I will try to run it. It will be better if you could share us the settings in your load test (with unit tests or web tests). Or you could share us a simple sample.
There Is No Disk in the Drive. Please Insert a Disk into Drive \Device\harddisk\Dr1
I never met this issue, and it seems that it is related to your removable drive like this article:
http://support.microsoft.com/kb/330137.
About the “/noisolation”, Edwer gave us some information, if possible, you could see: http://social.msdn.microsoft.com/Forums/eu/vststest/thread/4e0ae0bc-9e07-4505-943d-aa309be2465a.
In addition, did you try to run a load test with “/TestContainer”? See http://msdn.microsoft.com/en-us/library/ms182588.aspx. Hope it could help.
If still no help, you could share us your project, we will try to check it. Thanks for your understanding.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
26 апреля 2012 г. 14:07
Hello Jack,
Yes, there is no problem when I run the loadtest from VS IDE. The steps I follow to run my test with MSTest are same as http://blogs.msdn.com/b/yutong/archive/2010/03/26/web-load-test-automation.aspx. I am using RunHelper and TestRunner from the link.
My RunHelper is exactly same as that. And my TestRunner is as follows:
public class TestRunner
{
// Specify a proper timeout for you testing
static readonly int TIMEOUT = 120000;
static public void RunTestdataUniTest()
{
string resultfile_name = string.Format("{0}_{1:yyyy-MM-dd_hh-mm-ss-tt}.trx", "Unittest", DateTime.Now);
string testresults_dest = "C:\\TestResults";
string result_file_path = Path.Combine(testresults_dest, resultfile_name);
RunHelper.RunMSTest(@"C:\MyTests\bin\Debug\MyTests.dll",
@"C:\MyTests\Local.testsettings",
@result_file_path,
TIMEOUT);
}
static public void RunTestdataLoadTest()
{
string resultfile_name = string.Format("{0}_{1:yyyy-MM-dd_hh-mm-ss-tt}.trx", "Loadtest", DateTime.Now);
string testresults_dest = "C:\\TestResults";
string result_file_path = Path.Combine(testresults_dest, resultfile_name);
RunHelper.RunMSTest(@"C:\MyTests\bin\Debug\TestData.loadtest",
@"C:\MyTests\Local.testsettings",
@result_file_path,
TIMEOUT);
}
}I do run my loadtests using /TestContainer.
And my loadtest settings are :
TestMix : 100% MyUnitTest
Network : 100% LAN
Step Load Pattern
Counters : Application and Some custom countersets
Getting perf counters from 3 different VMs
Thanks
sonali joshi
- Изменено sjjj 26 апреля 2012 г. 14:13 edited to add loadtest settings
-
27 апреля 2012 г. 10:00Модератор
Hi sonali,
Glad to receive your reply.
- I would make sure that: whether it worked well before? If it worked, I’m afraid that we could try to reset the VS settings and use the default settings to check it.
- If you just use the similar TestRunner class in the blog provide by you, whether it has this issue? Since it seems that you have change more code in this class, if it works, I’m afraid that it is related to your defined TestRunner class, since other class is exactly same.
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
1 мая 2012 г. 5:05Модератор
Hi sonali,
I am writing to check the status of the issue on your side.
What about this problem now?
Would you mind letting us know the result of the suggestion?
Best Regards,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
1 мая 2012 г. 15:01
Hi Jack,
I checked you suggestions. Thanks for them. But the thing is I am using the default settings all this time. And I am really not sure if there is any problem with Testrunner class because all I am doing is passing the parameter sets to run two different tests.
Having said that, I am seeing this problem once in a while now. That is there isn't really any pattern in which I see this problem. I, sometimes, am able to run loadtest consecutively but not all the time. (I would say 60% success rate)...I just re-run the test if it fails. Haven't found any sound solution on it. But I do appreciate your help and efforts.
Thanks again.
Sonali
sonali joshi
-
2 мая 2012 г. 2:23Модератор
Hi sonali,
You're welcome! J
Since it works well when you run it in the VS IDE, so we could make sure that the tests work well.
As you said that sometimes it has this issue and sometimes it works when you run it in the command line, so I agree with you, it is hard to find the real solution. Would you mind submitting this feedback to Microsoft Connect feedback portal: http://connect.microsoft.com? Microsoft engineers will evaluate them seriously. You could post this thread’s link in your feedback, and I think it will be useful for them.
In addition, if possible, you could share us the link about the feedback in this thread, I will vote it, anyway, thank you for sending feedback to us, and it makes the Visual Studio better.
Have a nice day,
Jack Zhai [MSFT]
MSDN Community Support | Feedback to us
-
3 мая 2012 г. 15:25
Hello Jack,
Sorry for delayed reply.
I have submitted a bug. The link is here :
I appreciate your time and help :)
Regards,
sonali joshi
- Помечено в качестве ответа Jack Zhai - MSFTMicrosoft Contingent Staff, Moderator 4 мая 2012 г. 3:13

