Fix #99549: Remember Previous Status #104217
No reviewers
Labels
No Label
Good First Issue
Priority
High
Priority
Low
Priority
Normal
Status
Archived
Status
Confirmed
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Job Type
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: studio/flamenco#104217
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "Evelinealy/flamenco:web-api-upgrade"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix #99549: When sending Workers offline, remember their previous status
When the status of a worker goes offline, the Manager will now make the status of the worker to be remembered once it goes back online. So when the Worker makes this status change (so for example
X → offline
), Manager should immediately setStatusRequested = "X"
once it goes online.Congrats on your first pull reqeust!
I can confirm that the feature is working, and that the test that tests it is passing as well. If that sentence looks oddly specific, it is ;-)
We've all fallen into this trap; that one test works, but a few of its siblings now need adjustments as well. Before sending in a PR, remember to run
make test
to run all unit tests.Note that a Shaman test might fail, which is tracked separately in #104218 and fixing that is out of scope for this PR.Update: I've committed a fix.
Marking as 'changes requested'
Thank you for the reminder, I'll try to run all the tests and see what I can fix up. Thanks for fixing the Shaman issue!
Ah, so it's the TestSetSchedule in the sleep_scheduler_test.go file that is not happy. It gives this issue:
I'll retrace the function to see why I'm getting the error in theSetWorkerSleepSchedule
function.Actually, looking at it. It seems to be unhappy with the timezone. It's "getting" 09:00:00 -0700 PDT (which is my timezone), but wants 18:00:00 +0200 +0200. I don't want to exactly "fix" this because I'm not sure if this would mess someone else up. Were there any other errors you were getting besides the SetWorkerSleepSchedule?
I've merged my code so that it's up-to-date with your current fix.
Hah, the perils of cross-timezone development.
Yeah, check my comment above. It has two lines starting with
--- FAIL:
that show the name of the tests that are failing.Okay, the signoff tests are not happy either. I'll take a look at them! Thanks!
Yeah, those are the important ones. The rest is caused by #104219 -- check that issue for a workaround.
Good news! I got the
TestWorkerSignoffTaskRequeue
andTestWorkerSignoffStatusChangeRequest
passed. Turns out it was simpler than I thought. Just had to update the BroadcastWorkerUpdate and SaveWorkerStatus parameters. You can see it in my branch here (I spelled TestWorkerSignoffTaskRequeue with a q...oops) :7cb484967c
That was 5 hours worth of debugging and headbanging, I can't believe it was that simpleWhen I run the whole test code, I still get some errors shown up
job_compilers_test.go
andcalculations_test.go
. Although, the calculation's one seems to be more related to the timezone, I want to double-check and make sure. I'll work on the job compiler's issue as well.Are there any more errors on your end that you see and I missed them?
For me all the tests pass now, including the timezone-related ones.
Just a few small remarks left.
@ -14,3 +14,3 @@
"[yaml]": {
"editor.autoIndent": "keep",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "esbenp.prettier-vscode"
Such IDE configuration changes shouldn't be in the same PR as functional changes to Flamenco itself.
This to me is showing that we shouldn't have
.vscode/settings.json
in the repository at all; it's too fragile. It was fine when I was the only one working on the Go code, but it's clear that this doesn't work when we both are.To keep things simple, it's ok for now to keep these changes in here. After this PR is merged, I'll remove the file entirely and add it to
.gitignore
.@ -278,3 +286,3 @@
savedWorker.Status = api.WorkerStatusOffline
savedWorker.StatusChangeClear()
mf.persistence.EXPECT().SaveWorkerStatus(gomock.Any(), &savedWorker).Return(nil)
mf.persistence.EXPECT().SaveWorkerStatus(gomock.Any(), gomock.Any()).Return(nil)
I can imagine this works, as it removes the entire check against
savedWorker
and accepts any value instead. That's a bit too weak for a unit test though.👌