Skip to content

Commit f2b49aa

Browse files
authored
Merge pull request #17 from Silv3rcircl3/build_fix
Fixed some bugs that occur when the script is running on the build se…
2 parents 77c5274 + 5ad0cbb commit f2b49aa

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

build.fsx

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ let testOutput = "TestResults"
5050

5151
let nugetDir = binDir @@ "nuget"
5252
let workingDir = binDir @@ "build"
53-
let libDirPortable = workingDir @@ @"lib\portable-net45+netcore45\"
54-
let libDir45 = workingDir @@ @"lib\net45\"
5553
let nugetExe = FullName @"src\.nuget\NuGet.exe"
5654
let slnFile = "./src/Reactive.Streams.sln"
5755

@@ -133,7 +131,7 @@ Target "RunTests" <| fun _ ->
133131
let nunitToolPath = findToolInSubPath "nunit3-console.exe" "src/packages/FAKE/NUnit.ConsoleRunner/tools"
134132
printfn "Using NUnit runner: %s" nunitToolPath
135133
NUnit3
136-
(fun p -> { p with ToolPath = nunitToolPath; ResultSpecs = [testOutput + "/TestResults.xml"] })
134+
(fun p -> { p with ToolPath = nunitToolPath; ResultSpecs = [testOutput + "/TestResults.xml"]; Workers = Some(1) })
137135
nunitTestAssemblies
138136

139137
//--------------------------------------------------------------------------------
@@ -169,22 +167,27 @@ let createNugetPackages _ =
169167
DeleteDir dir
170168
not (directoryExists dir)
171169
runWithRetries del 3 |> ignore
172-
170+
171+
let mutable dirId = 1
172+
173173
ensureDirectory nugetDir
174174
for nuspec in !! "src/**/*.nuspec" do
175175
printfn "Creating nuget packages for %s" nuspec
176176

177-
CleanDir workingDir
178-
177+
let tempBuildDir = workingDir + dirId.ToString()
178+
ensureDirectory tempBuildDir
179+
//clean it in case this target gets run multiple times. Which if it does is a bug. But hey since TC throws an exception when the dir is actually not empty. Its a nice circuitbreaker
180+
CleanDir tempBuildDir
181+
182+
let libDirPortable = tempBuildDir @@ @"lib\portable-net45+netcore45\"
183+
let libDir45 = tempBuildDir @@ @"lib\net45\"
179184
let project = Path.GetFileNameWithoutExtension nuspec
180185
let projectDir = Path.GetDirectoryName nuspec
181186
let projectFile = (!! (projectDir @@ project + ".*sproj")) |> Seq.head
182187
let releaseDir = projectDir @@ @"bin\Release"
183188
let packages = projectDir @@ "packages.config"
184189
let packageDependencies = if (fileExists packages) then (getDependencies packages) else []
185-
let dependencies = packageDependencies @ getDependency project
186-
let releaseVersion = getProjectVersion project
187-
190+
188191
let pack outputDir symbolPackage =
189192
NuGetHelper.NuGet
190193
(fun p ->
@@ -195,14 +198,14 @@ let createNugetPackages _ =
195198
Project = project
196199
Properties = ["Configuration", "Release"]
197200
ReleaseNotes = release.Notes |> String.concat "\n"
198-
Version = releaseVersion
201+
Version = release.NugetVersion
199202
Tags = tags |> String.concat " "
200203
OutputPath = outputDir
201-
WorkingDir = workingDir
204+
WorkingDir = tempBuildDir
202205
SymbolPackage = symbolPackage
203-
Dependencies = dependencies })
206+
Dependencies = packageDependencies })
204207
nuspec
205-
208+
206209
// Copy dll, pdb and xml to libdir = workingDir/lib/net4x/
207210
let libDir = if project.Contains ".TCK" then libDir45 else libDirPortable
208211
ensureDirectory libDir
@@ -215,7 +218,7 @@ let createNugetPackages _ =
215218
|> CopyFiles libDir
216219

217220
// Copy all src-files (.cs and .fs files) to workingDir/src
218-
let nugetSrcDir = workingDir @@ @"src/"
221+
let nugetSrcDir = tempBuildDir @@ @"src/"
219222
// CreateDir nugetSrcDir
220223

221224
let isCs = hasExt ".cs"
@@ -232,6 +235,7 @@ let createNugetPackages _ =
232235
// Uses the files we copied to workingDir and outputs to nugetdir
233236
pack nugetDir NugetSymbolPackage.Nuspec
234237

238+
dirId <- dirId + 1
235239

236240
let publishNugetPackages _ =
237241
let rec publishPackage url accessKey trialsLeft packageFile =
@@ -399,4 +403,4 @@ Target "All" DoNothing
399403
"RunTests" ==> "All"
400404
"Nuget" ==> "All"
401405

402-
RunTargetOrDefault "Help"
406+
RunTargetOrDefault "Help"

src/tck/Reactive.Streams.TCK/TestEnvironment.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class TestEnvironment
1111
{
1212
public const int TestBufferSize = 16;
1313
private const string DefaultTimeoutMillisEnv = "DEFAULT_TIMEOUT_MILLIS";
14-
private const long DefaultTimeoutMillis = 100;
14+
private const long DefaultTimeoutMillis = 500;
1515
private const string DefaultNoSignalsTimeoutMillisEnv = "DEFAULT_NO_SIGNALS_TIMEOUT_MILLIS";
1616

1717

0 commit comments

Comments
 (0)