question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issues with tests using Mac and Linux containers

See original GitHub issue

Using Rider, my project’s tests will run fine: all tests are green. But when I run the tests from the command line, using “dotnet test myProject.csproj”, then certain tests will get the exception listed below. I’m wondering if there is a known fix for this. Notably, I can often get the tests to pass if I shorten either the test class name, or the test function name. However, it is not limited to this because, often, tests with longer names will pass even though the shorter named tests fail.

(The project itself is “LiquidProjections.Couchbase”. More on that later perhaps.) The error is:

LiquidProjections.Couchbase.Tests.CouchbaseProjectorSpecs.When_event_requires_update_to_a_projector.Then_it_should_be_updated [FAIL] Failed LiquidProjections.Couchbase.Tests.CouchbaseProjectorSpecs.When_event_requires_update_to_a_projector.Then_it_should_be_updated [1 ms] Error Message: System.AggregateException : One or more errors occurred. (Projector failed to project an event.) ---- LiquidProjections.ProjectionException : Projector failed to project an event. -------- System.ArgumentException : The output byte buffer is too small to contain the encoded data, encoding ‘Unicode (UTF-8)’ fallback ‘System.Text.EncoderReplacementFallback’. (Parameter ‘bytes’) Stack Trace: at LiquidProjections.Testing.MemorySubscription.WaitUntilCheckpoint(Int64 checkpoint) at LiquidProjections.Testing.MemoryEventSource.WaitForAllSubscriptions() at LiquidProjections.Testing.MemoryEventSource.Write(Object[] events) at Chill.GivenSubject1.<>c__DisplayClass6_0.<When>b__0() at Chill.Common.TaskExtensions.ExecuteInDefaultSynchronizationContext(Action action) at Chill.TestBase.TriggerTest(Action testAction, Boolean expectExceptions) at Chill.GivenSubject1.TriggerTest(Boolean expectExceptions) at Chill.TestBase.EnsureTestTriggered(Boolean expectExceptions) at Chill.GivenSubject1.When(Action whenAction, Nullable1 deferredExecution) at Chill.GivenSubject1.When(Func1 whenActionAsync, Nullable1 deferredExecution) at LiquidProjections.Couchbase.Tests.CouchbaseProjectorSpecs.When_event_requires_update_to_a_projector..ctor(CouchbaseFixture databaseFixture, ITestOutputHelper helper) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase.Tests/CouchbaseProjectorSpecs.cs:line 530 ----- Inner Stack Trace ----- at LiquidProjections.Couchbase.CouchbaseProjector1.ProjectTransactionStoreCheckpoint(Transaction transaction, IBucket bucket) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseProjector.cs:line 155 at LiquidProjections.Couchbase.CouchbaseProjector1.<>c__DisplayClass11_0.<<Handle>b__0>d.MoveNext() in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseProjector.cs:line 112 --- End of stack trace from previous location where exception was thrown --- at LiquidProjections.Couchbase.CouchbaseProjector1.ExecuteWithRetry(Func1 action) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseProjector.cs:line 165 at LiquidProjections.Couchbase.CouchbaseProjector1.ExecuteWithRetry(Func1 action) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseProjector.cs:line 172 at LiquidProjections.Couchbase.CouchbaseProjector1.Handle(IEnumerable1 transactions, SubscriptionInfo info) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseProjector.cs:line 112 at LiquidProjections.Testing.MemorySubscription.RunAsync(SubscriptionInfo info) at LiquidProjections.Testing.MemorySubscription.<>c__DisplayClass12_0.<<Start>b__0>d.MoveNext() ----- Inner Stack Trace ----- at System.Text.Encoding.ThrowBytesOverflow() at System.Text.Encoding.ThrowBytesOverflow(EncoderNLS encoder, Boolean nothingEncoded) at System.Text.Encoding.GetBytesWithFallback(ReadOnlySpan1 chars, Int32 originalCharsLength, Span1 bytes, Int32 originalBytesLength, EncoderNLS encoder) at System.Text.Encoding.GetBytesWithFallback(Char* pOriginalChars, Int32 originalCharCount, Byte* pOriginalBytes, Int32 originalByteCount, Int32 charsConsumedSoFar, Int32 bytesWrittenSoFar) at System.Text.UTF8Encoding.GetBytes(Char* chars, Int32 charCount, Byte* bytes, Int32 byteCount) at Couchbase.Core.IO.Converters.ByteConverter.FromString(String value, Span1 buffer) at Couchbase.Core.IO.Operations.OperationBase.WriteKey(Span1 buffer) at Couchbase.Core.IO.Operations.OperationBase.WriteKey(OperationBuilder builder) at Couchbase.Core.IO.Operations.OperationBase.SendAsync(IConnection connection, CancellationToken cancellationToken) at Couchbase.Core.IO.Connections.DataFlow.DataFlowConnectionPool.<>c__DisplayClass29_0.<<BuildHandler>b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Couchbase.Core.ClusterNode.ExecuteOp(Func4 sender, IOperation op, Object state, CancellationToken token) at Couchbase.Core.ClusterNode.SendAsync(IOperation op, CancellationToken token) at Couchbase.CouchbaseBucket.SendAsync(IOperation op, CancellationToken token) at Couchbase.CouchbaseBucket.SendAsync(IOperation op, CancellationToken token) at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationToken token) at Couchbase.Core.BucketBase.RetryAsync(IOperation operation, CancellationToken token) at Couchbase.KeyValue.CouchbaseCollection.RetryUntilTimeoutOrSuccessAsync(Nullable1 token, Nullable1 timeout, IOperation op) at Couchbase.KeyValue.CouchbaseCollection.ExecuteGet(String id, GetOptions options, IInternalSpan span) at Couchbase.KeyValue.CouchbaseCollection.GetAsync(String id, GetOptions options) at LiquidProjections.Couchbase.CouchbaseEventMapConfigurator1.OnUpdate(String key, CouchbaseProjectionContext context, Func2 projector, Func1 createIfMissing) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseEventMapConfigurator.cs:line 88 at LiquidProjections.EventMapBuilder3.CrudAction1.UpdateAction.OnUpdate(Func4 projector, TEvent anEvent, TContext context) at LiquidProjections.EventMapBuilder1.Action1.<>c__DisplayClass5_1.<<As>b__1>d.MoveNext() — End of stack trace from previous location where exception was thrown — at LiquidProjections.EventMapBuilder1.Action1.<>c__DisplayClass6_0.<<Add>b__0>d.MoveNext() — End of stack trace from previous location where exception was thrown — at LiquidProjections.EventMap1.Handle(Object anEvent, TContext context) at LiquidProjections.Couchbase.CouchbaseEventMapConfigurator1.ProjectEvent(Object anEvent, CouchbaseProjectionContext context) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseEventMapConfigurator.cs:line 33 at LiquidProjections.Couchbase.CouchbaseProjector`1.ProjectTransaction(Transaction transaction, IBucket bucket) in /Users/mlearner/work/repos/RCM/LiquidProjections.Couchbase/src/LiquidProjections.Couchbase/CouchbaseProjector.cs:line 215

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
malclearcommented, Jul 10, 2022

I’m not dealing with this problem any more, though I don’t remember finding any resolution to it. And we’re using LP successfully!

0reactions
dennisdoomencommented, Mar 7, 2022

Did you resolve this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to run test containers with Apple Silicon Mac #3834
This issue happens on my machine(Mac M1), and the solution of adding testImplementation 'net.java.dev.jna:jna-platform:5.8.0' into build.gradle ...
Read more >
Test Container test cases are failing due to "Could not find ...
I am very new to using test containers. My test is failing with below exception. ... My question is do I need docker...
Read more >
Known issues
Find known issues for Docker Desktop.
Read more >
Instantly Improve Docker Performance on Mac - Nimbus
Docker performance on Mac has a poor reputation and performance. Let's talk about why that is and what you can do to improve...
Read more >
Docker on MacOS is slow and how to fix it
The short answer for now is: Docker Desktop for Mac with VirtioFS, is a good compromise between performance and DX, even if it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found