diff --git a/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.Test_Exceptions_Receive_Cache_fileName=False.verified.json b/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.Test_Exceptions_Receive_Cache_fileName=False.verified.json index ca0b8ecc..544801d7 100644 --- a/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.Test_Exceptions_Receive_Cache_fileName=False.verified.json +++ b/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.Test_Exceptions_Receive_Cache_fileName=False.verified.json @@ -1,24 +1,13 @@ { "Type": "AggregateException", - "InnerExceptions": [ - { + "InnerException": { "Message": "The method or operation is not implemented.", "Data": {}, "InnerException": null, "HelpLink": null, "Source": "Speckle.Sdk.Serialization.Tests", "HResult": -2147467263, - "StackTrace": " at Speckle.Sdk.Serialization.Tests.Framework.ExceptionSendCacheManager.SaveObjects(IEnumerable`1 items) in C:\\Users\\adam\\Git\\speckle-sharp-sdk\\tests\\Speckle.Sdk.Serialization.Tests\\Framework\\ExceptionSendCacheManager.cs:line 19\r\n at Speckle.Sdk.Serialisation.V2.Receive.ObjectLoader.SaveToCache(List`1 batch) in C:\\Users\\adam\\Git\\speckle-sharp-sdk\\src\\Speckle.Sdk\\Serialisation\\V2\\Receive\\ObjectLoader.cs:line 116\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass98_0`1.b__0(T e)\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass92_0`1.b__2(T item, Int64 _)\r\n at Open.ChannelExtensions.Extensions.ReadUntilCancelledAsync[T](ChannelReader`1 reader, CancellationToken cancellationToken, Func`3 receiver, Boolean deferredExecution)\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass92_0`1.<g__Read|1>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass92_0`1.<g__Read|1>d.MoveNext()" + "StackTrace": " at Speckle.Sdk.Serialization.Tests.Framework.ExceptionSendCacheManager.SaveObjects(IEnumerable`1 items) in C:\\Users\\adam\\Git\\speckle-sharp-sdk\\tests\\Speckle.Sdk.Serialization.Tests\\Framework\\ExceptionSendCacheManager.cs:line 19\r\n at Speckle.Sdk.Serialisation.V2.Receive.ObjectLoader.SaveToCache(List`1 batch) in C:\\Users\\adam\\Git\\speckle-sharp-sdk\\src\\Speckle.Sdk\\Serialisation\\V2\\Receive\\ObjectLoader.cs:line 116\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass98_0`1.b__0(T e)\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass63_0`1.b__0(T e, Int64 _)\r\n at Open.ChannelExtensions.Extensions.ReadUntilCancelledAsync[T](ChannelReader`1 reader, CancellationToken cancellationToken, Func`3 receiver, Boolean deferredExecution)\r\n at Open.ChannelExtensions.Extensions.ReadAllAsync[T](ChannelReader`1 reader, Func`3 receiver, Boolean deferredExecution, CancellationToken cancellationToken)" }, - { - "Message": "The method or operation is not implemented.", - "Data": {}, - "InnerException": null, - "HelpLink": null, - "Source": "Speckle.Sdk.Serialization.Tests", - "HResult": -2147467263, - "StackTrace": " at Speckle.Sdk.Serialization.Tests.Framework.ExceptionSendCacheManager.SaveObjects(IEnumerable`1 items) in C:\\Users\\adam\\Git\\speckle-sharp-sdk\\tests\\Speckle.Sdk.Serialization.Tests\\Framework\\ExceptionSendCacheManager.cs:line 19\r\n at Speckle.Sdk.Serialisation.V2.Receive.ObjectLoader.SaveToCache(List`1 batch) in C:\\Users\\adam\\Git\\speckle-sharp-sdk\\src\\Speckle.Sdk\\Serialisation\\V2\\Receive\\ObjectLoader.cs:line 116\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass98_0`1.b__0(T e)\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass92_0`1.b__2(T item, Int64 _)\r\n at Open.ChannelExtensions.Extensions.ReadUntilCancelledAsync[T](ChannelReader`1 reader, CancellationToken cancellationToken, Func`3 receiver, Boolean deferredExecution)\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass92_0`1.<g__Read|1>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Open.ChannelExtensions.Extensions.<>c__DisplayClass92_0`1.<g__Read|1>d.MoveNext()" -} - ], "StackTrace": "at Speckle.Sdk.Dependencies.Serialization.ChannelLoader`1.CheckForExceptions()\nat Speckle.Sdk.Serialisation.V2.Receive.ObjectLoader.GetAndCache(String rootId, DeserializeProcessOptions options, CancellationToken cancellationToken)\nat Speckle.Sdk.Serialisation.V2.Receive.DeserializeProcess.Deserialize(String rootId)\n--- End of stack trace from previous location ---\nat Xunit.Assert.RecordExceptionAsync(Func`1 testCode)" } diff --git a/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.cs b/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.cs index 12ca9af8..33f06b87 100644 --- a/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.cs +++ b/tests/Speckle.Sdk.Serialization.Tests/ExceptionTests.cs @@ -68,7 +68,13 @@ public async Task Test_Exceptions_Receive_Server(string fileName, string rootId, closures.Count.Should().Be(oldCount); var o = new ObjectLoader(new DummySqLiteReceiveManager(closures), new ExceptionServerObjectManager(), null); - using var process = new DeserializeProcess(null, o, new ObjectDeserializerFactory(), default, new(true)); + using var process = new DeserializeProcess( + null, + o, + new ObjectDeserializerFactory(), + default, + new(true, MaxParallelism: 1) + ); var ex = await Assert.ThrowsAsync(async () => { @@ -95,7 +101,7 @@ public async Task Test_Exceptions_Receive_Cache(string fileName, string rootId, o, new ObjectDeserializerFactory(), default, - new(MaxParallelism: 2) + new(MaxParallelism: 1) ); Exception ex; diff --git a/tests/Speckle.Sdk.Serialization.Tests/Framework/ExceptionScrubber.cs b/tests/Speckle.Sdk.Serialization.Tests/Framework/ExceptionScrubber.cs index 38853e3b..1f352af7 100644 --- a/tests/Speckle.Sdk.Serialization.Tests/Framework/ExceptionScrubber.cs +++ b/tests/Speckle.Sdk.Serialization.Tests/Framework/ExceptionScrubber.cs @@ -18,7 +18,7 @@ public override void Write(VerifyJsonWriter writer, Exception value) if (value.StackTrace != null) { var ex = JsonConvert.SerializeObject(value, Formatting.Indented); - var newString = InteralizeStacktrace().Replace(ex, ""); + var newString = InteralizeStacktrace().Replace(ex, "").Trim(); writer.WriteRawValue(newString); return; }