Skip to content

Commit e989c21

Browse files
committed
Fix for stream termination
1 parent c86605c commit e989c21

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

ReleaseNotes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 1.1.1
22

3+
- [Fix] Handles premature stream termination when reading events in the server
4+
35
# 1.1.0
46

57
- [Feature] Support for server read cancellation with a `CancellationToken`

build.cake

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ Task("Restore")
8585
{
8686
MSBuildSettings = msBuildSettings
8787
});
88-
89-
// Run NuGet CLI restore to handle the Framework test projects
90-
NuGetRestore($"./{projectName}.sln");
9188
});
9289

9390
Task("Build")
@@ -106,7 +103,7 @@ Task("Build")
106103
Task("Test")
107104
.Description("Runs all tests.")
108105
.IsDependentOn("Build")
109-
.Does(() =>
106+
.DoesForEach(GetFiles("./tests/*Tests/*.csproj"), project =>
110107
{
111108
DotNetCoreTestSettings testSettings = new DotNetCoreTestSettings()
112109
{
@@ -123,12 +120,10 @@ Task("Test")
123120
testSettings.TestAdapterPath = GetDirectories($"./tools/Appveyor.TestLogger.*/build/_common").First();
124121
}
125122

126-
foreach (var project in GetFiles("./tests/*Tests/*.csproj"))
127-
{
128-
Information($"Running tests in {project}");
129-
DotNetCoreTest(MakeAbsolute(project).ToString(), testSettings);
130-
}
131-
});
123+
Information($"Running tests in {project}");
124+
DotNetCoreTest(MakeAbsolute(project).ToString(), testSettings);
125+
})
126+
.DeferOnError();
132127

133128
Task("Pack")
134129
.Description("Packs the NuGet packages.")

src/MsBuildPipeLogger.Server/PipeLoggerServer.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,20 @@ public BuildEventArgs Read()
8181
return null;
8282
}
8383

84-
BuildEventArgs args = _buildEventArgsReader.Read();
85-
if (args != null)
84+
try
8685
{
87-
Dispatch(args);
88-
return args;
86+
BuildEventArgs args = _buildEventArgsReader.Read();
87+
if (args != null)
88+
{
89+
Dispatch(args);
90+
return args;
91+
}
8992
}
93+
catch(EndOfStreamException)
94+
{
95+
// The stream may have been closed or otherwise stopped
96+
}
97+
9098
return null;
9199
}
92100

0 commit comments

Comments
 (0)