Skip to content

Give the dosing tests ten seconds to wait on the data queue - #2558

Merged
marionbarker merged 1 commit into
devfrom
fix/dosing-tests-wait-timeouts
Oct 7, 2026
Merged

marionbarker merged 1 commit into
devfrom
fix/dosing-tests-wait-timeouts

Conversation

@ps2

@ps2 ps2 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

On CircleCI (LoopKit/LoopWorkspace#520, build 1224) two tests in LoopDataManagerDosingTests failed:

testLoopEnactsTempBasalWithoutManualBolusRecommendation, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "dataQueue"
testValidateMaxTempBasalCancelsTempBasalIfLower, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "dataQueue"

Both start with waitOnDataQueue(), which waited one second for getLoopState. On the CI simulator that expired, the tests carried on while the manager was still working, the assertions saw a nil recommendation, and the Loop test host then died with Fatal error: Index out of range. The same tests pass locally and passed on the Sept 29 CI run, so this is load-sensitive.

This raises waitOnDataQueue's default and the other one-second waits in that file to ten seconds. Longer timeouts cost nothing when the tests pass and remove the race that follows a timed-out wait. LoopTests passes locally with the change.

The one-second waits in LoopDataManagerDosingTests expired on CircleCI's
simulator, so two tests asserted against a manager that was still
working and the test host then crashed with an index out of range. A
longer timeout costs nothing when the tests pass.

@marionbarker marionbarker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes make sense if the problem is the timeout.

@marionbarker
marionbarker merged commit 691afb3 into dev Oct 7, 2026
@ps2
ps2 deleted the fix/dosing-tests-wait-timeouts branch October 8, 2026 19:03
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