Skip to content

[Bug] Immediate seek after a seek will fail with NotConnected #520

@BewareMyPower

Description

@BewareMyPower

Search before asking

  • I searched in the issues and found nothing similar.

Version

master

Minimal reproduce step

TEST(ConsumerTest, testSeekAfterSeek) {
    const auto topic = "test-seek-after-seek-" + std::to_string(time(nullptr));
    const auto subscription = "sub";
    Client client(lookupUrl);
    Consumer consumer;
    ASSERT_EQ(ResultOk, client.subscribe(topic, subscription, consumer));
    ASSERT_EQ(ResultOk, consumer.seek(TimeUtils::currentTimeMillis()));
    ASSERT_EQ(ResultOk, consumer.seek(MessageId::earliest()));
    ASSERT_EQ(ResultOk, consumer.seek(TimeUtils::currentTimeMillis()));
    client.close();
}

Run the test above

What did you expect to see?

All seek calls should succeed

What did you see instead?

Expected equality of these values:
  ResultOk
    Which is: Ok
  consumer.seek(MessageId::earliest())
    Which is: NotConnected

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions