Open Closed

tests failing after adding typeof(AbpBackgroundWorkersHangfireModule) module #5649


User avatar
0
sukhdeep.dhillon created
  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Database System: EF Core (SQL Server)

Hi, when I add the following module to the application layer typeof(AbpBackgroundWorkersHangfireModule). all the application tests starts failing

following is the screenshot of the application module class

following is the screenshot of error I'm getting after adding this module typeof(AbpBackgroundWorkersHangfireModule)


10 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can configure in-memory storage for Hangfire in the .TestBase project https://www.nuget.org/packages/Hangfire.InMemory

    context.Services.AddHangfire(config =>
    {
      config.UseInMemoryStorage();
    });
    
  • User Avatar
    0
    sukhdeep.dhillon created

    Thanks, it worked.

    but I have another question, as I'm using Hangfire workers to run background tasks.

    what are these 2 extra hangfire period jobs automatically created. the one is highlighted is mine.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    • BackgroundJobWorker is a built-in worker in ABP that is used for BackgroundJob system.
    • TokenCleanupBackgroundWorkers is a built-in worker in ABP that is used to clean the old tokens.
  • User Avatar
    0
    sukhdeep.dhillon created

    since I have started using Hangfireworker, app sometime stuck at the following error

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    I don't see any errors

  • User Avatar
    0
    sukhdeep.dhillon created

    yes, no error, but if you look at the time line, app kind of stuck, doesn't load

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi

    I didn't understand what you meant, Can you explain in detail?

  • User Avatar
    0
    sukhdeep.dhillon created

    I mean when I start the application, the application takes longer time to run as I have shared in the previous screenshot. (screenshot shows the initial logs when we start the app with kestrel server) in the screenshot you can see the time 13:22 to 13:26 and the app didn't up yet, app kind of stuck at the startup

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Sorry, I see that hangfire is outputting the log. Your application seems to be running.this looks fine

    Could you share the full logs? thanks.

  • User Avatar
    0
    sukhdeep.dhillon created

    I'm not able to replicate the issue because it happens once in a while. I will reopen this ticket if the issue comes back

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38