-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* LongSendTest * Moved to separate project * Server transport throws early * raised timeouts * Use poly for timeout * Cleaned up some of the AsyncPolicy construction * GraphQL Client back to 30 second timeout
- Loading branch information
Showing
11 changed files
with
363 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
using Speckle.Objects.Geometry; | ||
using Speckle.Sdk; | ||
using Speckle.Sdk.Api; | ||
using Speckle.Sdk.Credentials; | ||
using Speckle.Sdk.Host; | ||
using Speckle.Sdk.Logging; | ||
using Speckle.Sdk.Models; | ||
using Speckle.Sdk.Transports; | ||
|
||
//Replace this with a brand new model URL | ||
Uri modelUrl = new("https://testing1.speckle.dev/projects/cdedc63e6d/models/2d68380f1d"); | ||
|
||
//Keep this as-is, copy the Data.db into %appdata%/longsendtest/Data.db | ||
const string OBJECT_ID = "5cbf84a0061172102ef8a66ae914f232"; | ||
|
||
SetupSpeckle(); | ||
var testData = await GetSampleData(OBJECT_ID); | ||
await SendToSpeckle(testData, modelUrl); | ||
|
||
return; | ||
|
||
static async Task SendToSpeckle(Base testData, Uri modelUrl) | ||
{ | ||
SpeckleLog.Logger.Information("Starting Long Send Test Send"); | ||
var destinationTransport = await GetDestination(modelUrl); | ||
|
||
var (res, _) = await Operations.Send(testData, new[] { destinationTransport }); | ||
SpeckleLog.Logger.Information("Starting Send was successful: {objectId}", res); | ||
} | ||
|
||
static async Task<ITransport> GetDestination(Uri modelUrl) | ||
{ | ||
StreamWrapper sw = new(modelUrl.ToString()); | ||
var acc = await sw.GetAccount(); | ||
return new ServerTransport(acc, sw.StreamId); | ||
} | ||
|
||
static async Task<Base> GetSampleData(string objectId) | ||
{ | ||
SpeckleLog.Logger.Information("Gathering Sample Data Set"); | ||
using SQLiteTransport source = new(SpecklePathProvider.UserApplicationDataPath(), "longsendtest"); | ||
MemoryTransport memoryTransport = new(); | ||
return await Operations.Receive(objectId, source, memoryTransport); | ||
} | ||
|
||
static void SetupSpeckle() | ||
{ | ||
TypeLoader.Initialize(typeof(Base).Assembly, typeof(Point).Assembly); | ||
var config = new SpeckleConfiguration( | ||
new("Long Send Problem Test Script", "LongSend"), | ||
default, | ||
new( | ||
MinimumLevel: SpeckleLogLevel.Debug, | ||
Console: true, | ||
File: new(Path: "SpeckleCoreLog.txt"), | ||
Otel: new( | ||
Endpoint: "https://seq.speckle.systems/ingest/otlp/v1/logs", | ||
Headers: new() { { "X-Seq-ApiKey", "agZqxG4jQELxQQXh0iZQ" } } | ||
) | ||
), | ||
new( | ||
Console: false, | ||
Otel: new( | ||
Endpoint: "https://seq.speckle.systems/ingest/otlp/v1/traces", | ||
Headers: new() { { "X-Seq-ApiKey", "agZqxG4jQELxQQXh0iZQ" } } | ||
) | ||
) | ||
); | ||
Setup.Initialize(config); | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/Speckle.LongSendProblem/Speckle.LongSendProblem.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Speckle.Objects\Speckle.Objects.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.