diff options
| author | Craig Jennings <c@cjennings.net> | 2026-02-03 08:36:37 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-02-03 08:36:37 -0600 |
| commit | 3b11eff3165db185f8177839f96fd27761af19a9 (patch) | |
| tree | 33727263cbc76d958aa7986892f783cf3fae2cf4 /tests/test-video-audio-recording-process-sentinel.el | |
| parent | 8af6ef2f8618687b414f9e6b064cf77b8333d73c (diff) | |
fix(tests): correct flaky test assertions
- calendar-sync: fix GTFO count bounds to match 15-month window (was
incorrectly assuming 12-month/52-week window)
- video-recording: add process-status mock to prevent race condition
where process hadn't exited yet when sentinel was manually called
Diffstat (limited to 'tests/test-video-audio-recording-process-sentinel.el')
| -rw-r--r-- | tests/test-video-audio-recording-process-sentinel.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test-video-audio-recording-process-sentinel.el b/tests/test-video-audio-recording-process-sentinel.el index 37a7f94d..92fb3f0d 100644 --- a/tests/test-video-audio-recording-process-sentinel.el +++ b/tests/test-video-audio-recording-process-sentinel.el @@ -79,8 +79,10 @@ (let ((fake-process (make-process :name "test-audio" :command '("sh" "-c" "exit 0"))) (update-called nil)) (setq cj/audio-recording-ffmpeg-process fake-process) - ;; Mock force-mode-line-update to track if it's called - (cl-letf (((symbol-function 'force-mode-line-update) + ;; Mock process-status to return 'exit and force-mode-line-update to track call + (cl-letf (((symbol-function 'process-status) + (lambda (_proc) 'exit)) + ((symbol-function 'force-mode-line-update) (lambda (&optional _all) (setq update-called t)))) (cj/recording-process-sentinel fake-process "finished\n") (should update-called))) @@ -124,8 +126,10 @@ (let ((fake-process (make-process :name "test-audio" :command '("sh" "-c" "exit 0"))) (message-text nil)) (setq cj/audio-recording-ffmpeg-process fake-process) - ;; Mock message to capture output - (cl-letf (((symbol-function 'message) + ;; Mock process-status to return 'exit and message to capture output + (cl-letf (((symbol-function 'process-status) + (lambda (_proc) 'exit)) + ((symbol-function 'message) (lambda (fmt &rest args) (setq message-text (apply #'format fmt args))))) (cj/recording-process-sentinel fake-process " finished \n") ;; Message should contain trimmed event |
