- checkout: self
clean: true
fetchDepth: 5
-
+
- bash: |
$(dockerfilesFolder)/build-docker-sdk.sh -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
+ echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
+ name: buildRuntime
displayName: Build CLR and Libraries
-
+
- bash: |
$(httpStressProject)/run-docker-compose.sh -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
+ echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
+ name: buildStress
displayName: Build HttpStress
-
+
- bash: |
cd '$(httpStressProject)'
export HTTPSTRESS_CLIENT_ARGS="$HTTPSTRESS_CLIENT_ARGS -http 2.0"
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 2.0"
docker-compose up --abort-on-container-exit --no-color
- displayName: Run HttpStress - HTTP/2
+ displayName: Run HttpStress - HTTP 2.0
+ condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
- bash: |
cd '$(httpStressProject)'
export HTTPSTRESS_SERVER_ARGS="$HTTPSTRESS_SERVER_ARGS -http 1.1"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 1.1
+ condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
- job: windows
displayName: Docker NanoServer
clean: true
fetchDepth: 5
lfs: false
-
+
- powershell: |
$(dockerfilesFolder)/build-docker-sdk.ps1 -w -t $(sdkBaseImage) -c $(BUILD_CONFIGURATION)
+ echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
+ name: buildRuntime
displayName: Build CLR and Libraries
-
+
- powershell: |
$(httpStressProject)/run-docker-compose.ps1 -w -o -c $(BUILD_CONFIGURATION) -t $(sdkBaseImage)
+ echo "##vso[task.setvariable variable=succeeded;isOutput=true]true"
+ name: buildStress
displayName: Build HttpStress
-
+
- powershell: |
cd '$(httpStressProject)'
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 2.0"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 2.0"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 2.0
-
+ condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
+
- powershell: |
cd '$(httpStressProject)'
$env:HTTPSTRESS_CLIENT_ARGS = "$env:HTTPSTRESS_CLIENT_ARGS -http 1.1"
$env:HTTPSTRESS_SERVER_ARGS = "$env:HTTPSTRESS_SERVER_ARGS -http 1.1"
docker-compose up --abort-on-container-exit --no-color
displayName: Run HttpStress - HTTP 1.1
+ condition: and(eq(variables['buildRuntime.succeeded'], 'true'), eq(variables['buildStress.succeeded'], 'true'))
\ No newline at end of file
}
catch (Exception e)
{
- _aggregator.RecordFailure(e, opIndex, stopwatch.Elapsed, taskNum: taskNum, iteration: i);
+ _aggregator.RecordFailure(e, opIndex, stopwatch.Elapsed, requestContext.IsCancellationRequested, taskNum: taskNum, iteration: i);
}
}
// Representative error text of stress failure
public string ErrorText { get; }
// Operation id => failure timestamps
- public Dictionary<int, List<(DateTime timestamp, TimeSpan duration)>> Failures { get; }
+ public Dictionary<int, List<(DateTime timestamp, TimeSpan duration, bool isCancelled)>> Failures { get; }
public StressFailureType(string errorText)
{
ErrorText = errorText;
- Failures = new Dictionary<int, List<(DateTime timestamp, TimeSpan duration)>>();
+ Failures = new Dictionary<int, List<(DateTime timestamp, TimeSpan duration, bool isCancelled)>>();
}
public int FailureCount => Failures.Values.Select(x => x.Count).Sum();
_latencies.Add(elapsed.TotalMilliseconds);
}
- public void RecordFailure(Exception exn, int operationIndex, TimeSpan elapsed, int taskNum, long iteration)
+ public void RecordFailure(Exception exn, int operationIndex, TimeSpan elapsed, bool isCancelled, int taskNum, long iteration)
{
DateTime timestamp = DateTime.Now;
lock (failureType)
{
- if(!failureType.Failures.TryGetValue(operationIndex, out List<(DateTime timestamp, TimeSpan duration)>? timestamps))
+ if(!failureType.Failures.TryGetValue(operationIndex, out List<(DateTime timestamp, TimeSpan duration, bool isCancelled)>? details))
{
- timestamps = new List<(DateTime timestamp, TimeSpan duration)>();
- failureType.Failures.Add(operationIndex, timestamps);
+ details = new List<(DateTime timestamp, TimeSpan duration, bool isCancelled)>();
+ failureType.Failures.Add(operationIndex, details);
}
- timestamps.Add((timestamp, elapsed));
+ details.Add((timestamp, elapsed, isCancelled));
}
(Type exception, string message, string callSite)[] ClassifyFailure(Exception exn)
Console.WriteLine(failure.ErrorText);
Console.WriteLine();
Console.ForegroundColor = ConsoleColor.Yellow;
- foreach (KeyValuePair<int, List<(DateTime timestamp, TimeSpan duration)>> operation in failure.Failures)
+ foreach (KeyValuePair<int, List<(DateTime timestamp, TimeSpan duration, bool isCancelled)>> operation in failure.Failures)
{
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write($"\t{_operationNames[operation.Key].PadRight(30)}");
Console.Write("Fail: ");
Console.ResetColor();
Console.Write(operation.Value.Count);
- Console.WriteLine($"\tTimestamps: {string.Join(", ", operation.Value.Select(x => $"{x.timestamp:HH:mm:ss.fffffff} in {x.duration}"))}");
+ Console.WriteLine($"\t{string.Join(", ", operation.Value.Select(x => $"Timestamps: {x.timestamp:HH:mm:ss.fffffff}, Duration: {x.duration}, Cancelled: {x.isCancelled}"))}");
}
Console.ForegroundColor = ConsoleColor.Cyan;
private class StructuralEqualityComparer<T> : IEqualityComparer<T> where T : IStructuralEquatable
{
- public bool Equals([AllowNull] T left, [AllowNull] T right) => left != null && left.Equals(right, StructuralComparisons.StructuralEqualityComparer);
+ public bool Equals(T? left, T? right) => left != null && left.Equals(right, StructuralComparisons.StructuralEqualityComparer);
public int GetHashCode([DisallowNull] T value) => value.GetHashCode(StructuralComparisons.StructuralEqualityComparer);
}
}