Skip to content

Conversation

@jhford
Copy link
Contributor

@jhford jhford commented Feb 14, 2019

This is missing whatever is needed to start and stop the pollers in the
queue unit tests because I cannot make sense of how polling is managed
in the tests.

Bugzilla Bug: 1527583

@jhford jhford self-assigned this Feb 14, 2019
@djmitche djmitche self-requested a review February 14, 2019 14:07
Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

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

The service's polling is started in withPollingServices in test/helper.js, and specifically helper.startPollingService.

testing.poll runs the given function repeatedly, delaying beween runs, until it succeeds. The idea is to keep checking until the dependency tracker runs.

We use runWithFakeTime, which sets up zurvan, which fakes out all of Node's timers.

Logging with just DEBUG=iterate,watchdog, I see that it runs an iteration and then schedules the next one. Logging the duration it's scheduling, it's 250000, since pollingDelay is in ms and waitTime is in seconds. With that fixed, the tests pass.


It would be great to update all of the polled services to use tc-lib-iterate at the same time.


Note: unrelated to this issue, withPollingService should probably call svc.terminate() in a teardown function, just to avoid missing that when a test fails (and probably causing mayhem for subsequent tests). That might be a nice drive-by fix to include here.

Note 2: the "..after passage of.." error message has the incorrect time. It's using a value that is decremented down to zero. Oops. A fix for that would be great, too.

@djmitche djmitche requested a review from a team March 4, 2019 22:53
@djmitche
Copy link
Collaborator

djmitche commented Mar 5, 2019

merging as a break-fix

@djmitche djmitche merged commit 5487ee6 into master Mar 5, 2019
@djmitche
Copy link
Collaborator

djmitche commented Mar 5, 2019

The queue tests were failing to run, which is why they were green despite needing 6e5c4fd

@djmitche
Copy link
Collaborator

djmitche commented Mar 5, 2019

I think @imbstack has fixed that issue in master already.

@imbstack imbstack deleted the bug1527583 branch March 5, 2019 15:50
Copy link
Contributor

@imbstack imbstack left a comment

Choose a reason for hiding this comment

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

retroactive r+

petemoore added a commit that referenced this pull request Feb 6, 2020
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.

4 participants