Maven test runs fail on some machines


Today I got this error when I ran a Maven build with the test goal on the new build server that I configured to compile the Java code.

[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ xxxxxx —
[INFO] Changes detected – recompiling the module!
[INFO] Compiling 67 source files to C:\Sc\ xxxxxx \target\classes
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 6.551 s
[INFO] Finished at: 2016-02-08T17:31:25-05:00
[INFO] Final Memory: 11M/61M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project xxxxxx Compilation failure -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

I have the same .m2 folder as the other build severs. Maven and the JDK are configured properly as well. The only difference turned out to be that this server had a newer version of the Java JDK than the other servers. After inspecting the pom.xml file, I noticed that the maven-compiler-plugin had the javac.exe path hard coded

<plugin>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<fork>true</fork>

<executable>C:\Program Files\Java\jdk1.8.0_66\bin\javac.exe</executable>

</configuration>

</plugin>

I removed the hardcoded path and specified the Java version instead.

<plugin>

<artifactId>maven-compiler-plugin</artifactId>

<version>3.1</version>

<configuration>

<fork>true</fork>

<source>1.8</source>

<target>1.8</target>

</configuration>

</plugin>

You can also follow the instructions at http://maven.apache.org/plugins/maven-compiler-plugin/examples/compile-using-different-jdk.html to target multiple versions of the JDK

Categories: Java Tags: , ,

Azure Cloud Load Testing – Part 2


In the previous blog post, I showed how easy it is to initiate a load test from Azure by just providing a URL of the web page you want to load test, specify the number of users and the duration. This is great for websites where requests are GET requests or you are not trying to test a user scenario that consists of multiple steps. In this post, I will show how to use Azure Cloud Load Testing in a more advanced scenario that consists of multiple steps.

Prerequisites

In order to record a performance test which will be used for load testing, you need to have Visual Studio Enterprise or Ultimate Edition. You can download a 30 day trial version

Recording a Scenario

  • Open Visual Studio
  • Create a new Web Performance and Load Test project

  • Click the record button on your web test

  • Go through the scenario you want to record. I uploaded the scenario I recorded at https://youtu.be/6-ZiIL7yPpA
  • I recorded a test to go from the home page to the search page and then perform a search

You can test your script by clicking the run test button

Create a Load Test

A load test can consist of one or more test scenario. You can also define the duration of your test and the number of users to simulate running the test. Let’s create and configure a load test which will run in Azure.

  • Right click on your project
  • Add a load test by right clicking on the project and add a new itm

  • On the wizard, I am selecting a Cloud-based Load Test and click next

  • Select the location where the load will be generated from and click next

  • On the Run Settings page, you select the duration of the run and then click next

  • On the scenario page, name the scenario and select the Think time profile, think time is the duration between your test steps

  • On the Load pattern page, you can select a constant load of users or if you want to start with a smaller number of users and ramp up the user users while your test is running. I am using a constant load but you may want to use the second option if that what you want to simulate.

  • On the test mix page, you can select one or more tests. in my case I am only selecting one web test. You can also selected MSTest unit tests as well.

  • Add the browsers you want your users to use during the test

  • Click the Run load test button

  • Click on the Performance or Throughput buttons to see the graphs. The application button with capture the Application Insights telemetry

Conclusion

In this post, I showed how to create a performance and load test using Visual Studio 2015 Enterprise Edition and leverage Azure Cloud Load Testing to execute the recorded test. I didn’t have to create any Virtual Machines or install test agents to run my load test. I had to push a button and monitor the test run. Cloud load testing would save you a lot of money in infrastructure purchases and labour costs when you want to run load tests to similar millions of users and you want to only run the test scenarios for few weeks a year. The first 20,000 Virtual User Minutes (VUMs) a month are free. Give it a try today.

Offline Installation of TFS Eclipse Plugin


I was working with one client with a locked down dev environment (i.e. no internet access on dev machines). They use TFS as their ALM tool. Long story short, I wanted to install the TFS Eclipse Plugin. The following are the steps that I went through to install the plugin offline.

Download TFS Eclipse Plugin (version 14.02 is available at https://www.microsoft.com/en-us/download/details.aspx?id=47727)

  • Open Eclipse
  • Click on Help à Install New Software


  • Click the Add button then the Archive button
  • Select the zip file for the TFS Eclipse plugin
  • Click the Open button


  • Check The Team Explorer Everywhere plugin and click the next button. Eclipse will calculate the dependency. This may take few minutes


  • Click the next button on Install Details window


  • Accept the license agreement and click the Finish button
  • Click Yes to restart Eclipse


  • Click the Open Perspective button, Select Team Foundation Sever Exploring and click OK


Connect Eclipse to TFS Server

  • Click on Connect to Team Foundation Server then click the Servers button
  • Click the Add button to add a new TFS server
  • Type in the TFS url


  • Click OK and close the Add/Remove TFS window
  • Select your team project and click the Finish button


Categories: ALM, Uncategorized Tags: , , ,

TFS Build: Unable to load task handler PowerShell for task …


While I was trying run a TFS build for the first time on a Windows 2008 R2 SP1 machine, I got the following error

Unable to load task handler PowerShell for task Maven with version 1.0.13

To determine the Powershell version that is installed on your system:

Open Windows Powershell

Type $PSVersionTable.PSVersion

If you have a version that is lower than 3.0, you will need to update to a recent version of Powershell

In my case, I had PS 2.0 installed. I upgraded to PS 4.0 which I downloaded from

http://www.microsoft.com/en-us/download/details.aspx?id=40855

and that fixed my issue

PS: read the installation instructions to determine proper file name to download

 

Categories: ALM, TFS2015 Tags: , , , , ,

Release Management: Communication with the deployer was lost during the deployment (The parameter is incorrect)


At one of my clients, I got this error on Release Management 2015:

Communication with the deployer was lost during the deployment. Please make sure (1) the deployer machine has not rebooted during installation and (2) the component timeout is sufficient to copy the files from the drop location to the deployer machine and install the package.

History:

The Release Management database was migrated from environment to another following the steps at http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/02/need-to-migrating-release-management-server.aspx

I didn’t migrate the machine key because we are only migrating the database and not the server.

Troubleshooting

Open the Deployment Agent log. The default location should be at

C:\Users\<user>\AppData\Local\Temp\Microsoft\ReleaseManagement\14.0\Logs

Where <user> is the user who initiates the build (e.g. your username, build_service user, etc)

In my case, I had the following error

{“ErrorMessage”:”The parameter is incorrect.\r\n”}
12/14/2015 9:20:32 AM – Error – (9528, 9260) – Error while converting string to XDocument: [Data at the root level is invalid. Line 1, position 1.] [   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at Microsoft.TeamFoundation.Release.Common.ExtensionMethods.XmlExtensionMethods.ToXDocument(String value, Boolean preserveWhitespace)].

The error doesn’t give a lot of information.

On the Release Management server, take a look at Release Management Services log which is located at

C:\Users\<RM user>\AppData\Local\Temp\Microsoft\ReleaseManagement\14.0\Logs\ReleaseManagementServices.log

Where <RM user> is the username of the RM account

ConfigureRM

In the ReleaseManagementServices.log, I saw the following error

Request http://rmserver:1000/account/releaseManagementService/_apis/releaseManagement/TfsService/DoesBuildExists?tfsServerId=1&teamProjectName=Services&buildDefinition=MyBuild&buildNumber=BuildName-1.1.28.21&api-version=6.0 threw exception: System.Security.Cryptography.CryptographicException: The parameter is incorrect.

The CryptographicException caught my attention. I visited the Release Management release definition and there was an encrypted password field.

Solution

Reenter the password in the password field and start new  a release

 

 

Azure Cloud Load Testing Made Easy


Load testing is a very import milestone in your development lifecycle that is usually ignored. Load testing allows you to discover how your system behaves while x number of users are using your application. It may uncover performance issues and hence you can optimize the code or beef up your hardware.

On Premises Load Testing

It is fairly easy to build a test lab to host your Visual Studio Test Controller and Visual Studio Test Agents. Microsoft MSDN documentation recommends one dual core CPU and 2GB for each Test Agent to support 1000 virtual users. In other words, you will need 20 core with at least 20GB of ram to create 10 VM’s to simulate 10,000 users or 200 cores and 200GB of ram to create VM’s to simulate 100,000 users and so on. As you can see it may get so expensive to purchase all that hardware, hire people to build and maintain your servers and add to that the hydro bill.

Azure Cloud Load Testing (CLT)

Microsoft Azure allows you with clicking of few buttons to leverage cloud agents to perform your load test. Current, you can only use 25,000 VUsers (100 cores) for up to an hour per test. If you want to increase those limits you can either run up to 10 test in parallel to use up to 1000 cores or 250,000 users or contact Microsoft at vsoloadtest@microsoft.com. As of today, Each Visual Studio Online account gets a free 25,000 Virtual User Minutes (VUMin)

Getting Started with Cloud Load Testing

Prerequisites

To create a load test from the Azure website you need

  • Azure account
  • VSO account that is linked to your Azure account. (as of today, your VSO account needs to be created in Azure)
  • Azure Web App (Your websites can be hosted out of Azure)
  • URL

Steps

Microsoft made it really easy to load test a single URL. The following is a step by step instructions on how get started with Azure Cloud Load Testing:

  • Go to https://portal.azure.com/
  • Click on Web Apps
  • If you are hosting your site in Azure, select it, otherwise create a new one
  • Click on Tools

  • On the Tools panel, clicks Performance Test

  • Click on Set Account

  • Click on Account to select an existing VSO account. If “Existing accounts” list is empty, follow the steps in the Create New Account section
  • Click OK to go back to the Performance tests panel

 

  • Click on New and fill the test info. The generate load from field allows you to select the geolocation where the test will be generated from.
  • If you are using a free Service Plan tier, you are limited to 40 user load for 1 Minute Duration. To change your Service Plan tier, follow the steps in the “Change Service Plan Tier” section

  • Click on Run test

  • You can run multiple tests from the same or different geographical location in parallel

Conclusion

Azure Cloud Load Testing allows you to hit the road and start load testing your application without waiting for an infrastructure to be built. In a future post, I will show how to use Visual Studio to build a more complex load test scenario while using Cloud Load Testing.

Create New VSO Account from Azure

  • While you are on the Account Settings panel, click “or create new account” hyper link

  • Type the name of the account and select the subscription

  • Click OK

Change Service Plan Tier

  • Click on Service Plan in the main Azure menu

  • Select the Service Plan you need to upgrade
  • Click on the Pricing tier tile

  • Select the pricing tier you want to upgrade your service plan to
Categories: ALM Tags: , , , ,

Xbap (ClickOnce): The underlying connection was closed: An unexpected error occurred on a send


Last week after deploying to one of one of the internal environments, we got the following error on the installation of an xbap application

An exception occurred while downloading the manifest. Following failure messages were detected:

+ Downloading https://<url>/app.xbap did not succeed.

+ The underlying connection was closed: An unexpected error occurred on a send.

+ Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

+ An existing connection was forcibly closed by the remote host

It turned out that the IT group had disabled TLS 1.0 and 1.1. After enabling those protocols, the xbap was operating as expected

Categories: Uncategorized
Follow

Get every new post delivered to your Inbox.

Join 465 other followers