I have an integration tests that fails intermittently with the following exception being thrown on a call to AppendToStream() :-
EventStore.ClientAPI.Exceptions.NotAuthenticatedException: Not Authenticated
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at EventStore.ClientAPI.EventStoreNodeConnection.AppendToStream(String stream, Int32 expectedVersion, IEnumerable`1 events, UserCredentials userCredentials)
The credentials are being set via ConnectionSettings.SetDefaultUserCredentials().
As part of the integration test the EventStore process is terminated and restarted after the connection is established but before the call to AppendToStream.
Any ideas why the NotAuthenticatedException is sometimes thrown?