Skip to content

libasyik causing Catch2 test case to stuck #19

Description

@triwahyuu

My test case in catch2 that uses libasyik service causing the test to not exit even when the all passed message is displayed.
I can reproduce it with this code:

TEST_CASE("Test service bug http", "[service_http_bug]")
{
  auto as = asyik::make_service();

  as->async([as]() {
    as->execute([as]()
      {
        LOG(INFO) << "start execute\n";
        asyik::sleep_for(std::chrono::milliseconds(2000));
        LOG(INFO) << "start request\n";
        asyik::http_easy_request(as, "GET", "https://isocpp.org/files/papers/N4860.pdf");
        LOG(INFO) << "finish execute\n";
      }
    );
    LOG(INFO) << "finish async\n";
    as->stop();
    LOG(INFO) << "service stopped\n";
  });

  as->run();
}

will results:
image

I need to stop the executable with ctrl+c manually

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions