Skip to content

O3-5485 Fix NaN average wait time when all queue entries have null endedAt#102

Open
RoshanMadival08 wants to merge 1 commit intoopenmrs:mainfrom
RoshanMadival08:O3-5485-fix-average-wait-time
Open

O3-5485 Fix NaN average wait time when all queue entries have null endedAt#102
RoshanMadival08 wants to merge 1 commit intoopenmrs:mainfrom
RoshanMadival08:O3-5485-fix-average-wait-time

Conversation

@RoshanMadival08
Copy link

@RoshanMadival08 RoshanMadival08 commented Mar 15, 2026

Description

Fixes an issue where computeAverageWaitTimeInMinutes could return NaN when all queue entries had null endedAt values.

Changes

  • Updated the logic to only calculate the average using entries that have both startedAt and endedAt.
  • Added a check to return 0 when there are no valid entries to calculate the wait time.
  • Added unit tests to cover this case.

Testing

Ran the test suite using:
mvn clean test

All tests passed successfully.

Related

https://openmrs.atlassian.net/browse/O3-5485

@sourav-jyoti
Copy link

hi @RoshanMadival08 , theres already a pending pr for this tckt, from next time raise pr only if theres no pending pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants