Fix #99549: Remember Previous Status #104217

Merged
Sybren A. Stüvel merged 16 commits from Evelinealy/flamenco:web-api-upgrade into main 2023-06-02 22:50:10 +02:00
Showing only changes of commit f4bbda0fdc - Show all commits

View File

@ -286,8 +286,8 @@ func TestWorkerRememberPreviousStatus(t *testing.T) {
savedWorker.StatusRequested = api.WorkerStatusAwake savedWorker.StatusRequested = api.WorkerStatusAwake
savedWorker.LazyStatusRequest = false savedWorker.LazyStatusRequest = false
mf.persistence.EXPECT().SaveWorkerStatus(gomock.Any(), &savedWorker).Return(nil) mf.persistence.EXPECT().SaveWorkerStatus(gomock.Any(), &savedWorker).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.

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.
mf.stateMachine.EXPECT().RequeueActiveTasksOfWorker(gomock.Any(), gomock.Eq(&worker), "worker signed off").Return(nil) mf.stateMachine.EXPECT().RequeueActiveTasksOfWorker(gomock.Any(), &worker, "worker signed off").Return(nil)
mf.persistence.EXPECT().WorkerSeen(gomock.Any(), gomock.Eq(&worker)) mf.persistence.EXPECT().WorkerSeen(gomock.Any(), &worker)
echo := mf.prepareMockedRequest(nil) echo := mf.prepareMockedRequest(nil)
requestWorkerStore(echo, &worker) requestWorkerStore(echo, &worker)