Logging repostore content on twoclient test failure
This commit is contained in:
parent
b81d574a4b
commit
1a277ef1b5
|
@ -49,6 +49,11 @@ namespace CodexPlugin
|
||||||
return Http().HttpGetJson<CodexDebugBlockExchangeResponse>("debug/blockexchange");
|
return Http().HttpGetJson<CodexDebugBlockExchangeResponse>("debug/blockexchange");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CodexDebugRepoStoreResponse[] GetDebugRepoStore()
|
||||||
|
{
|
||||||
|
return Http().HttpGetJson<CodexDebugRepoStoreResponse[]>("debug/repostore");
|
||||||
|
}
|
||||||
|
|
||||||
public CodexDebugThresholdBreaches GetDebugThresholdBreaches()
|
public CodexDebugThresholdBreaches GetDebugThresholdBreaches()
|
||||||
{
|
{
|
||||||
return Http().HttpGetJson<CodexDebugThresholdBreaches>("debug/loop");
|
return Http().HttpGetJson<CodexDebugThresholdBreaches>("debug/loop");
|
||||||
|
|
|
@ -165,4 +165,9 @@ namespace CodexPlugin
|
||||||
public string wantType { get; set; } = string.Empty;
|
public string wantType { get; set; } = string.Empty;
|
||||||
public bool sendDontHave { get; set; }
|
public bool sendDontHave { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class CodexDebugRepoStoreResponse
|
||||||
|
{
|
||||||
|
public string cid { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ namespace CodexPlugin
|
||||||
CodexDebugResponse GetDebugInfo();
|
CodexDebugResponse GetDebugInfo();
|
||||||
CodexDebugPeerResponse GetDebugPeer(string peerId);
|
CodexDebugPeerResponse GetDebugPeer(string peerId);
|
||||||
CodexDebugBlockExchangeResponse GetDebugBlockExchange();
|
CodexDebugBlockExchangeResponse GetDebugBlockExchange();
|
||||||
|
CodexDebugRepoStoreResponse[] GetDebugRepoStore();
|
||||||
ContentId UploadFile(TrackedFile file);
|
ContentId UploadFile(TrackedFile file);
|
||||||
TrackedFile? DownloadContent(ContentId contentId, string fileLabel = "");
|
TrackedFile? DownloadContent(ContentId contentId, string fileLabel = "");
|
||||||
void ConnectToPeer(ICodexNode node);
|
void ConnectToPeer(ICodexNode node);
|
||||||
|
@ -87,6 +88,11 @@ namespace CodexPlugin
|
||||||
return CodexAccess.GetDebugBlockExchange();
|
return CodexAccess.GetDebugBlockExchange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CodexDebugRepoStoreResponse[] GetDebugRepoStore()
|
||||||
|
{
|
||||||
|
return CodexAccess.GetDebugRepoStore();
|
||||||
|
}
|
||||||
|
|
||||||
public ContentId UploadFile(TrackedFile file)
|
public ContentId UploadFile(TrackedFile file)
|
||||||
{
|
{
|
||||||
using var fileStream = File.OpenRead(file.Filename);
|
using var fileStream = File.OpenRead(file.Filename);
|
||||||
|
|
|
@ -38,14 +38,29 @@ namespace ContinuousTests.Tests
|
||||||
{
|
{
|
||||||
TrackedFile? dl = null;
|
TrackedFile? dl = null;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
LogBytesPerMillisecond(() => dl = Nodes[1].DownloadContent(cid!));
|
LogBytesPerMillisecond(() => dl = Nodes[1].DownloadContent(cid!));
|
||||||
|
|
||||||
file.AssertIsEqual(dl);
|
file.AssertIsEqual(dl);
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
LogRepoStore(Nodes[0]);
|
||||||
|
LogRepoStore(Nodes[1]);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
LogBlockExchangeStatus(Nodes[0], "After download");
|
LogBlockExchangeStatus(Nodes[0], "After download");
|
||||||
LogBlockExchangeStatus(Nodes[1], "After download");
|
LogBlockExchangeStatus(Nodes[1], "After download");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LogRepoStore(ICodexNode codexNode)
|
||||||
|
{
|
||||||
|
var response = codexNode.GetDebugRepoStore();
|
||||||
|
Log.Log($"{codexNode.GetName()} has {string.Join(",", response.Select(r => r.cid))}");
|
||||||
|
}
|
||||||
|
|
||||||
private void LogStoredBytes(ICodexNode node)
|
private void LogStoredBytes(ICodexNode node)
|
||||||
{
|
{
|
||||||
var metrics = CreateMetricsAccess(node);
|
var metrics = CreateMetricsAccess(node);
|
||||||
|
|
Loading…
Reference in New Issue