From 22fc8668afd79c0884afe9149e721d97751d24d7 Mon Sep 17 00:00:00 2001 From: Tom Gardham-Pallister Date: Tue, 8 May 2018 22:57:59 +0100 Subject: [PATCH] hacking around --- src/Ocelot/Raft/HttpPeer.cs | 3 +++ test/Ocelot.IntegrationTests/RaftTests.cs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Ocelot/Raft/HttpPeer.cs b/src/Ocelot/Raft/HttpPeer.cs index 224a4474..b89c884c 100644 --- a/src/Ocelot/Raft/HttpPeer.cs +++ b/src/Ocelot/Raft/HttpPeer.cs @@ -88,6 +88,7 @@ namespace Ocelot.Raft public Response Request(T command) where T : ICommand { + Console.WriteLine("SENDING REQUEST...."); if(_token == null) { SetToken(); @@ -99,11 +100,13 @@ namespace Ocelot.Raft var response = _httpClient.PostAsync($"{_hostAndPort}/administration/raft/command", content).GetAwaiter().GetResult(); if(response.IsSuccessStatusCode) { + Console.WriteLine("REQUEST OK...."); var okResponse = JsonConvert.DeserializeObject>(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), _jsonSerializerSettings); return new OkResponse((T)okResponse.Command); } else { + Console.WriteLine("REQUEST NOT OK...."); return new ErrorResponse(response.Content.ReadAsStringAsync().GetAwaiter().GetResult(), command); } } diff --git a/test/Ocelot.IntegrationTests/RaftTests.cs b/test/Ocelot.IntegrationTests/RaftTests.cs index fc8a56a7..f196dacb 100644 --- a/test/Ocelot.IntegrationTests/RaftTests.cs +++ b/test/Ocelot.IntegrationTests/RaftTests.cs @@ -105,6 +105,7 @@ namespace Ocelot.IntegrationTests GivenFiveServersAreRunning(); GivenIHaveAnOcelotToken("/administration"); WhenISendACommandIntoTheCluster(command); + Thread.Sleep(5000); ThenTheCommandIsReplicatedToAllStateMachines(command); } @@ -261,8 +262,8 @@ namespace Ocelot.IntegrationTests } catch(Exception e) { - _output.WriteLine($"{e.Message}, {e.StackTrace}"); - Console.WriteLine(e); + //_output.WriteLine($"{e.Message}, {e.StackTrace}"); + //Console.WriteLine(e); return false; } }