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.

On stream restart, the mock stops working

See original GitHub issue

I got the following set-up: Producer actor -> Akka stream -> alpakka-amqp -> Consumer akka stream

When I restart either stream (which implies draining the stream, canceling upstream and completing downstream, and then creating a new stream with the same AmqpConnectionProvider and configs), the mock stops working with the new stream.

Using messageCount and consumerCount on the used channel shows the correct number of messages waiting to be read and the new consumer in there (for example, starts at one, goes to 0 when the stream is shutdown and back to 1 when it is recreated), but nothing is delivered to the stream.

Using the same set-up on a real RMQ server instead of the mock seems to be working. Any idea?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mdiasribeirocommented, Oct 14, 2019

@ledoyen Thanks for the update! Preliminary testing looks promising and seems to show that our issues have been fixed. I’ll be running tests over the week to confirm and ensure there are no further issues. Thanks!

0reactions
ledoyencommented, Oct 11, 2019

@mdiasribeiro It should be working fine now, thanks again for providing a test about this issue.

Check-out version 1.0.12 and let me know !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mock a method that returns a Stream and is called more than ...
Show activity on this post. Try the thenAnswer instead of thenReturn : Answer<Stream> answer = new Answer<Stream>() { public Stream answer( ...
Read more >
Some mocking tricks with jest - Ben Smithgall
When working with streams (most specifically something like fs.createWriteStream or @google-cloud/storage ), it's nice to have a real stream ...
Read more >
Returning stubbed HTTP responses to specific requests
Reset. The WireMock server can be reset at any time, removing all stub mappings and deleting the request log. If you're using either...
Read more >
Testing Kafka Streams
To test a Kafka Streams application, Kafka provides a test-utils artifact that ... Windowed, or Session), since the mock context does not manage...
Read more >
Testing Streams Code - Confluent Documentation
Streams provides MockProcessorContext in kafka-streams-test-utils for this purpose. To begin with, instantiate your processor and initialize it with the mock ...
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