Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ async Task DefaultOnTimeoutAction(Context context, TimeSpan timeout, Task task,
public AsyncPolicy BuildRetryPolicy()
{
var handleAndRetryPolicy = Policy
.Handle<HalibutClientException>(exceptionPredicate: ex => ex.IsNetworkError() != HalibutNetworkExceptionType.NotANetworkError)
.Handle<HalibutClientException>(exceptionPredicate: ex => ex.IsRetryableError() != HalibutRetryableErrorType.NotRetryable)
.WaitAndRetryAsync(
retryCount: int.MaxValue,
sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Min(retryAttempt, 10)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</Otherwise>
</Choose>
<ItemGroup>
<PackageReference Include="Halibut" Version="8.1.1040" />
<PackageReference Include="Halibut" Version="8.1.1423" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\Solution Items\SolutionInfo.cs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ public class TestContextConnectionLog : ILog, ILogWriter
readonly string endpoint;
readonly string name;
readonly LogLevel logLevel;
readonly Type? forContext;

public TestContextConnectionLog(string endpoint, string name, LogLevel logLevel)
public TestContextConnectionLog(string endpoint, string name, LogLevel logLevel, Type? forContext = null)
{
this.endpoint = endpoint;
this.name = name;
this.logLevel = logLevel;
this.forContext = forContext;
}

public void Write(EventType type, string message, params object?[] args)
Expand All @@ -35,15 +37,20 @@ public IList<LogEvent> GetLogs()
throw new NotImplementedException();
}

public ILog ForContext<T>()
{
return new TestContextConnectionLog(endpoint, name, logLevel, typeof(T));
}

void WriteInternal(LogEvent logEvent)
{
var logEventLogLevel = GetLogLevel(logEvent);

if (logEventLogLevel >= logLevel)
{
new SerilogLoggerBuilder().Build()
.ForContext<TestContextConnectionLog>()
.Write(GetSerilogLevel(logEvent), string.Format("{5, 16}: {0}:{1} {2} {3} {4}", logEventLogLevel, logEvent.Error, endpoint, Thread.CurrentThread.ManagedThreadId, logEvent.FormattedMessage, name));
var logger = new SerilogLoggerBuilder().Build();
logger = forContext != null ? logger.ForContext(forContext) : logger.ForContext<TestContextConnectionLog>();
logger.Write(GetSerilogLevel(logEvent), string.Format("{5, 16}: {0}:{1} {2} {3} {4}", logEventLogLevel, logEvent.Error, endpoint, Thread.CurrentThread.ManagedThreadId, logEvent.FormattedMessage, name));
}
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using Halibut.Diagnostics.LogCreators;
using Halibut.Logging;
using Octopus.Tentacle.Tests.Integration.Common.Logging;
using ILog = Halibut.Diagnostics.ILog;

namespace Octopus.Tentacle.Tests.Integration.Support.Logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public Decorator(IPendingRequestQueue inner, CancellationTokenSource cancellatio

public bool IsEmpty => inner.IsEmpty;
public int Count => inner.Count;
public async Task ApplyResponse(ResponseMessage response, ServiceEndPoint destination) => await inner.ApplyResponse(response, destination);
public async Task ApplyResponse(ResponseMessage response, Guid activityId) => await inner.ApplyResponse(response, activityId);
public async Task<RequestMessageWithCancellationToken?> DequeueAsync(CancellationToken cancellationToken) => await inner.DequeueAsync(cancellationToken);

public async Task<ResponseMessage> QueueAndWaitAsync(RequestMessage request, CancellationToken cancellationTokens)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public CancellationTokenObservingPendingRequestQueueDecorator(IPendingRequestQue
this.pendingRequestQueue = pendingRequestQueue;
}

public async Task ApplyResponse(ResponseMessage response, ServiceEndPoint destination)
public async Task ApplyResponse(ResponseMessage response, Guid activityId)
{
await pendingRequestQueue.ApplyResponse(response, destination);
await pendingRequestQueue.ApplyResponse(response, activityId);
}

public async Task<RequestMessageWithCancellationToken> DequeueAsync(CancellationToken cancellationToken)
Expand Down