DependencyTrack / DependencyTrack/dependency-track
Something wrong with ComponentAgePolicyEvaluator and/or -Test
- Dominant language
- Java
- Stars
- 4.2k
- Forks
- 811
- Avg merge
- 9h 4m
- Merged PRs (30d)
- 229
Description
### Current Behavior
While working on another issue, I ran all tests and at some point the tests for the ComponentAgePolicyEvaluator started failing.
I can't say the exact time it starts, but at midnight (my computer has TZ Europe/Vienna) the tests started working again!?
I suspect somewhere in there, there might be some issues with TimeZones or something similar. If it's the tests themselves, it's not a big issue, but if it's the evaluator, results may be incorrect, depending on when evaluation takes place!
### Steps to Reproduce
1. Hard to say -- pretty sure the tests fail *at least* between 11pm and midnight in Timezone Europe/Vienna, but it might be longer than this 1 hour as well...
### Expected Behavior
Tests succeed, no matter what time it is.
### Dependency-Track Version
4.8.0-SNAPSHOT
### Dependency-Track Distribution
Executable WAR
### Database Server
N/A
### Database Server Version
_No response_
### Browser
Mozilla Firefox
### Checklist
- [X] I have read and understand the [contributing guidelines](https://github.com/DependencyTrack/dependency-track/blob/master/CONTRIBUTING.md#filing-issues)
- [X] I have checked the [existing issues](https://github.com/DependencyTrack/dependency-track/issues) for whether this defect was already reported
Contributor guide
Research direction
Start with ComponentAgePolicyEvaluator and its tests, checking how they handle dates and time zones. Try reproducing the reported failures between 23:00 and midnight in Europe/Vienna, then compare behavior after midnight to distinguish a test issue from an evaluator defect. Done means the tests pass regardless of execution time and component-age evaluations remain correct across time-zone boundaries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 44/100