Skip to content

Flaky Test: StartSubscriberAsync_WhenConnectionShutsDown_Resubscribes #106

Closed

Description

@adeutscher

Identified a flaky test in RabbitMqSubscribeJobSourceTests. Everything merged in right with #104 and its update during development, so this must be flaky.

Test output from GitHub Actions run:

#17 16.69   Xunit.MicrosoftTestingPlatform.XunitException: Moq.MockException : 
#17 16.69   Expected invocation on the mock exactly 2 times, but was 1 times: c => c.BasicConsumeAsync("jobs", False, It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<bool>(), It.IsAny<IDictionary<string, object>>(), It.IsAny<IAsyncBasicConsumer>(), CancellationToken)
#17 16.69   
#17 16.69   Performed invocations:
#17 16.69   
#17 16.69      Mock<IChannel:37> (c):
#17 16.69   
#17 16.69         IChannel.BasicQosAsync(0, 65535, False, CancellationToken)
#17 16.69         IChannel.BasicConsumeAsync("jobs", False, "", False, False, null, AsyncEventingBasicConsumer, CancellationToken)
#17 16.69         IChannel.BasicQosAsync(0, 65535, False, CancellationToken)
#17 16.69         IChannel.BasicConsumeAsync("jobs", False, "", False, False, null, AsyncEventingBasicConsumer, CancellationToken)
#17 16.69   
#17 16.69     at Moq.Mock.Verify(Mock mock, LambdaExpression expression, Times times, String failMessage) in /_/src/Moq/Mock.cs:332
#17 16.70     at Moq.Mock`1.Verify[TResult](Expression`1 expression, Times times) in /_/src/Moq/Mock`1.cs:825
#17 16.70     at RedShirt.Example.JobWorker.JobManagement.RabbitMq.UnitTests.Tests.Services.RabbitMqSubscribeJobSourceTests.StartSubscriberAsync_WhenConnectionShutsDown_Resubscribes() in /build/test/RedShirt.Example.JobWorker.JobManagement.RabbitMq.UnitTests/Tests/Services/RabbitMqSubscribeJobSourceTests.cs:301
#17 16.70     --- End of stack trace from previous location ---

Activity

  1. self-assigned this
    on Aug 27, 2026
  2. adeutscher commented on Aug 31, 2026

    @adeutscher
    OwnerAuthor

    Had this crop up again. Just mentioning to log frequency.

  3. adeutscher commented on Aug 31, 2026

    @adeutscher
    OwnerAuthor

    Resolved in PR #113 along with #100 . Mistakenly tagged a completely separate and unrelated pair of issues in that PR.

  4. linked a pull request that will close this issueAttempt to address flaky tests. #113on Aug 31, 2026
  5. adeutscher commented on Sep 4, 2026

    @adeutscher
    OwnerAuthor

    Re-opening because this happened again: https://github.com/adeutscher/RedShirt.Example.JobWorker/actions/runs/33830947418/job/100893642263

    I wish GitHub issues were more open to being in some sort of review state instead of linking to a PR being an automatic closure on merge...

  6. adeutscher commented on Oct 12, 2026

    @adeutscher
    OwnerAuthor

    This has happened like 3 times in the last 24 hours. I should probably look into it again sometime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

CleanupImprove code qualitybugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions