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)

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

10 Answer(s)
  • User Avatar
    0
    liangshiwei created
    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();
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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.
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    sukhdeep.dhillon created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi

    I don't see any errors

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    sukhdeep.dhillon created

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    Fullstack Developer

    Hi

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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    liangshiwei created
    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.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • 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

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 24, 2026, 12:09
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.