Publishing test results fails - not sure why...

I ran a unit test and wanted to publish the results back to the "operational store" to see what would happen and if I could do something with the data - however I got the following error:

EndPublishRun: Server was unable to process request. > A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

The help is vague on what exactly is going on behind the scenes and I haven't found anything yet in my searches through the forums and various blogs.

Any help to this error would be appreciated, and if someone could point me to a more technical primer on this feature would be great!

Regards,

[747 byte] By [MichaelShorten] at [2008-2-20]
# 1
Do you currently have the Windows Firewall Enabled? If so, did you get a prompt to unblock Visual Studio?

As part of publishing we use some .net remoting, we need two way comms with the remote server.

If you dont have an exception for devenv, or use some other firewall and dont have rules set up appropriately, this could be why you are seeing the error.

If you could try this, and see if it works that would be great.

dhoptonMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 2
Hi!

No, I did not get anysort of popup or prompt when I tried to publish the data. Where could I look or what should I look for on the TFS Server (1 machine setup) to see if the error is on that end?

Regards,
Michael Shorten

MichaelShorten at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 3

If you checked on the client, then the only other area I can think of is if the firewall is configured on the server.

dhoptonMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 4
dhopton MSFT wrote:

If you checked on the client, then the only other area I can think of is if the firewall is configured on the server.

OK... anything in particular I should look for? What ports/packet types should be cleared through the firewall?

Regards,

MichaelShorten at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 5
Having looked at this - there are no other ports that need to be opened in the Server, other than the standard ports for TFS - that is 80 & 8080.

I know I keep pushing this issue, but if you have ANY firewall on the client (including XPSP2's Firewall), and that firewall is enable you must add an exception for visual studio otherwise you cannot publish.

dhoptonMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 6
dhopton MSFT wrote:
Having looked at this - there are no other ports that need to be opened in the Server, other than the standard ports for TFS - that is 80 & 8080.

I know I keep pushing this issue, but if you have ANY firewall on the client (including XPSP2's Firewall), and that firewall is enable you must add an exception for visual studio otherwise you cannot publish.

Well, here's the thing - I don't even get the dialog box that the Walkthru says I should get - when I click the Publish Test Results button, it just goes straight to the window and displays "No Test Runs were published." So I don't know that a connection is even being established.

Here's what I can tell you about my setup:

- I have Norton Antivirus only.
- I've confirmed that MSDE (as it's listed on the Security Center as such for B2) is cleared as an exception to the firewall.

Anything that I could look at on the event log or server side? This thing seems like it should be cooking.

Regards,

MichaelShorten at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 7
IF you have the windows firewall enabled:
Go to Control Panel
Windows Firewall
Exceptions Tab

See if "Microsoft Visual Studio 2005" is listed, and has a check box checked next to it. If not:

Add Program
Find Visual Studio (It should be listed, if not navigate to:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe or as appropriate)
Click Ok

Ensure that is is checked.

Restart VS.

Also, one additional port to check on the server: File & Print Sharing enabled - this is to enable files to be dropped correctly for big build.

dhoptonMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 8
dhopton MSFT wrote:
IF you have the windows firewall enabled:
Go to Control Panel
Windows Firewall
Exceptions Tab

See if "Microsoft Visual Studio 2005" is listed, and has a check box checked next to it. If not:

Add Program
Find Visual Studio (It should be listed, if not navigate to:
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe or as appropriate)
Click Ok

Ensure that is is checked.

Restart VS.

Also, one additional port to check on the server: File & Print Sharing enabled - this is to enable files to be dropped correctly for big build.


If the above steps are supposed to be on the client, I've already checked that VS05 is added - see my previous post. If this is supposed to be on the server... (quickly checks) the firewall is OFF on the server.
So - we've established that C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe is indeed a checked exception on the client and the server is NOT running the firewall.
What's next to look at?
Regards,

MichaelShorten at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 9
Sorry, I miss interpreted "MSDE" as Microsoft Data Engine (the baby SQL 2000).

I will talk to some people, and see if they have any suggestions - right now, I'm stumped.

dhoptonMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 10
Michael, can I get some basic information about the setup you have?

It sounds like you have the following:

Server:
Win2k3 SP1?
Application Tier
Data Tier
Big Build
Windows Firewall turned off

Client:
WinXP SP2?
VSTS
Windows Firewall turned on but with VS as an exception

All with beta 2 builds, right?
Also, can you please verify that you have the following setup?

- A team project containing at least one completed team build.
- A node within the team project selected in team explorer

How big is the test run that you are trying to publish? It sounds like it is fairly small, but I wanted to double check. Also, did you choose to include code coverage data when you published?

Finally, to verify that I am envisioning the steps you are taking properly, is the following correct?

- Select a node in team explorer
- Run some tests
- In the test results window, click on Publish Tests
- Select a test run and a build in the dialog displayed
- Click Publish
- The test results window changes its layout somewhat and displays the error message from your first post.

To give you a little bit of background on what is going on in the publish, here's the general idea. Some of this is changing for RTM, but for beta:

Once you click Publish from the publish dialog, we:
1. Open a .Net remoting channel on the client and pass the URI to this channel to the application tier web service (VSTFWeb, specifically :8080/TeamBuild/PublishTestResultsBuildService.asmx">http://<yourservername>:8080/TeamBuild/PublishTestResultsBuildService.asmx, the PublishRun method).
2. The web service then connects back to the remoting channel on the client to upload the files in the test run.
3. As the files are uploaded, the web service writes the files to the build drop share over SMB.
4. Once all the files are copied, the web service updates the tables in the operational store on the data tier.
5. The client waits asynchronously for all of this to happen. If the operation completes, the status is displayed in the Test Results window. If the operation times out or another client-side error occurs, that error is also displayed in the Test Results window.

Cheers,
Tom

TomNguyen-MarshMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 11
Hi Tom, thanks for writing.

Tom Nguyen-Marsh MSFT wrote:

It sounds like you have the following:

Server:
Win2k3 SP1?
Application Tier
Data Tier
Big Build
Windows Firewall turned off

Client:
WinXP SP2?
VSTS
Windows Firewall turned on but with VS as an exception

All with beta 2 builds, right?

That's correct.

Tom Nguyen-Marsh MSFT wrote:

Also, can you please verify that you have the following setup?

- A team project containing at least one completed team build.
- A node within the team project selected in team explorer

Umm.. now that's an interesting point, I do have a completed team build for this project. Why would that matter, just out of curiousity?

Tom Nguyen-Marsh MSFT wrote:

How big is the test run that you are trying to publish? It sounds like it is fairly small, but I wanted to double check. Also, did you choose to include code coverage data when you published?

Really darn small. I've tried for a unit test, a web test and a load test. All very small, either one function, one page or 2min/5user tests. And I've tried both with and without Code Coverage (I haven't been able to get Code Coverage to work with a web service test, but that's another thread... Heh)

Tom Nguyen-Marsh MSFT wrote:

Finally, to verify that I am envisioning the steps you are taking properly, is the following correct?

- Select a node in team explorer
- Run some tests
- In the test results window, click on Publish Tests
- Select a test run and a build in the dialog displayed
- Click Publish
- The test results window changes its layout somewhat and displays the error message from your first post.

Erm. Not exactly. I get to step 3 where I click on publish tests. I do NOT ever see a dialog pop up, the Results View goes straight to the "Publish Test" View and it states that no results were published. No visible errors that I can see.

Regards,

MichaelShorten at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 12

Hi, Michael,

Thanks for the info.

Re the requirement of having a team build, we associate test results with a team build. When you click on the Publish button in the test results window, you should see a drop-down of all the builds available for the project selected in the team explorer window. You have to choose one of these to be able to publish. If you have no builds, the drop-down will be empty and the Publish button will be disabled.

If you are not using team build to build your product, then you have two options:
- If you want per-build reporting, then create team builds that mirror your real builds. These builds don't need to actually build your source, they just need to exist on the Team Foundation server.
- If you don't care about per-build reporting, you can create a single team build and publish all of your tests against that build. If you are publishing code coverage data, I don't recommend this approach. We merge the coverage data from all test runs published against a build to give per-build coverage information. If you use a single build for the entire lifetime of your product, those merge operations would get very long.

So, now back to the problem at hand. :)

I'm not sure why you never even see the dialog, but I'd like to try to check whether the client is able to contact the server at all. Can you please try the following?

- Create the directory C:\logs and make sure that your Application Tier service account has write access to the directory.
- Turn on tracing for the Big Build web service on the AT machine by uncommenting the system.diagnostics tag in %programfiles%\Microsoft Visual Studio 2005 Enterprise Server\BBIISDIR\web.config.
- Run through your repro until you see the error message.
- Open the log file from c:\logs. It should be called teambuild.server.log.
- Search for "Entered method: GetListOfBuilds" and let me know if you find it. If you want, you can also look around for any other exceptions or errors that might be reported. For now, I just want to know whether the connection is being made to the server or not.

Cheers,
Tom

TomNguyen-MarshMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 13

Hi Tom, thanks for your reply.

I did as you asked and I found two files in C:\logs - here are the relevant bits. Just to confirm that I do have builds defined and can actually build, I ran one this morning and saw relevant success in actually building.

So, here's the contents of PublishWS.log:

[Info, 4712, 11, 09:21:31.894] Team Build Web - Application_BeginRequest
[Info, 4712, 11, 09:21:31.894] Team Build Web - Application_AuthenticateRequest
[Info, 4712, 11, 09:21:31.894] Entered System.Data.DataTable GetListOfBuilds(System.String) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.BuildInfo
[Info, 4712, 11, 09:21:31.894] Param: portfolioProject is Talladega
[Info, 4712, 11, 09:21:31.926] Entered Void .ctor() method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.DalBuildInfo
[Info, 4712, 11, 09:21:31.926] Created Connection object with connection string: Application Name=TeamBuild;Server=MSVS-TFS;Database=VSTEAMTeamBuild;Integrated Security=SSPI
[Info, 4712, 11, 09:21:31.926] Entered System.Data.DataTable GetListOfBuildsData(System.String) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.DalBuildInfo
[Info, 4712, 11, 09:21:31.926] Input parameters are: Talladega
[Info, 4712, 11, 09:21:31.926] Entered System.Data.DataTable ConvertSqlReaderToDataTable(System.Data.SqlClient.SqlDataReader, System.Collections.Hashtable) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.DalBuildInfo
[Info, 4712, 11, 09:21:31.957] Param: Table is Table: OpstoreDataTable, Columns: 11, Rows: 6
[Info, 4712, 11, 09:21:31.957] Leaving System.Data.DataTable GetListOfBuilds(System.String) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.BuildInfo
[Info, 4712, 11, 09:21:31.957] Team Build Web - Application_EndRequest
And the contents of TeamBuild.server.log:

[Info, 4712, 11, 09:21:31.894] Team Build Web - Application_BeginRequest
[Info, 4712, 11, 09:21:31.894] Team Build Web - Application_AuthenticateRequest
[Info, 4712, 11, 09:21:31.894] Entered System.Data.DataTable GetListOfBuilds(System.String) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.BuildInfo
[Info, 4712, 11, 09:21:31.894] Param: portfolioProject is Talladega
[Info, 4712, 11, 09:21:31.926] Entered Void .ctor() method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.DalBuildInfo
[Info, 4712, 11, 09:21:31.926] Created Connection object with connection string: Application Name=TeamBuild;Server=MSVS-TFS;Database=VSTEAMTeamBuild;Integrated Security=SSPI
[Info, 4712, 11, 09:21:31.926] Entered System.Data.DataTable GetListOfBuildsData(System.String) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.DalBuildInfo
[Info, 4712, 11, 09:21:31.926] Input parameters are: Talladega
[Info, 4712, 11, 09:21:31.926] Entered System.Data.DataTable ConvertSqlReaderToDataTable(System.Data.SqlClient.SqlDataReader, System.Collections.Hashtable) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.DalBuildInfo
[Info, 4712, 11, 09:21:31.957] Param: Table is Table: OpstoreDataTable, Columns: 11, Rows: 6
[Info, 4712, 11, 09:21:31.957] Leaving System.Data.DataTable GetListOfBuilds(System.String) method of type Microsoft.VisualStudio.TeamSystem.TeamBuild.Server.BuildInfo
[Info, 4712, 11, 09:21:31.957] Team Build Web - Application_EndRequest

So it seems that connections are being made, but I still do not get a dialog box and I do not get anything published that I can see.

What's next? *grin*
Regards,

MichaelShorten at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...
# 14

Hi,

We've had a deeper look and were trying to repro the issue and compare log files - I'll post back here when we've done that (it's in progress right now).

In the mean time we have one more thing for you to try -- publishing from the command line. To do this You'll need to work out the build ID for the build you are trying to publish too.

steps:
1: Connect to the Data Teir
2: Start SQL Manager
3: Open the VSTeamTeamBuild Database
4: Open the Builds table
5: Look for a value from the "BuildURI" Column

This is the build ID -- you can use this to publish from the command line.
example commandline:
mstest /testcontainer:path\to\test.dll /publishserver:http://server:8080 /publishbuild:06022_040032_70438

You need a VS Command prompt to invoke mstest.

Can you tell us what the outcome here is?

Also, I just want to confirm, for the sake of completeness that the dialogs and buttons you are pressing are correct.
1) You have selecting the correct Team Project in Team explorer, and the Publish button has become enabled (http://dhopton.projecthurricane.com/publish_button.JPG)
2) You are NOT seeing this dialog (http://dhopton.projecthurricane.com/publish_dialog.JPG). If you do see this dialog, then great. If not, we're still working on a possible reason for this.

When we've looked at our trace logs, I'll post back again.

dhoptonMSFT at 2007-9-8 > top of Msdn Tech,Visual Studio Team System,Visual Studio Team System - Web and Load Testing...

Visual Studio Team System

Site Classified