HangfireIO / HangfireIO/Hangfire

Recreation of Hangfire Services results in Jobs not getting queued in integration tests

Open
#2,293 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

I wrote a base class for integration tests of custom job filters.
The class completely recreates the DI-Container and the HangfireJobClient and Server for every test.
I currently have three tests for a cutom filter we use which all pass when run in isolation but as soon as I run them in one session (NUnit) only the first one passes. In subsequent test runs the job client won't return a job id when enqueueing.

Does hangfire keep some static settings in memory that has to be cleared for this to work?

the flow of the tests is as follow:

Register all relevant services (incl. hangfire) -> Create DI-Container -> Create JobClient & Server -> Run test method -> Dispose Server.

Contributor guide

Open the contributing guide

Research direction

Start with the NUnit integration tests and the base class that recreates the DI container, HangfireJobClient, and Server for each test. Reproduce the sequence in one session, comparing isolated and subsequent runs; done means all three custom-filter tests enqueue jobs and receive job IDs consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.