Skip to content

Commit aff800a

Browse files
ChuckBuildsclaude
andcommitted
test(on-demand): read the last on-demand state write, not the last cache write
test_it_is_reported_as_an_error took call_args_list[-1], which the font-usage publisher thread can write after the controller (font_usage_snapshot). It fails Core unit tests on main since #748 (every main run since). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b8e930b commit aff800a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎test/test_on_demand_live_and_restore.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,10 @@ def test_the_session_ends(self, restored):
120120
def test_it_is_reported_as_an_error(self, restored):
121121
assert restored.on_demand_status == 'error'
122122
assert restored.on_demand_last_error == 'restore-failed'
123-
published = restored.cache_manager.set.call_args_list[-1]
124-
assert published.args[0] == 'display_on_demand_state'
123+
# The last on-demand state write, not the last write of any key: the
124+
# font-usage publisher thread writes its own key at its own pace.
125+
published = [c for c in restored.cache_manager.set.call_args_list
126+
if c.args and c.args[0] == 'display_on_demand_state'][-1]
125127
assert published.args[1]['status'] == 'error'
126128
assert published.args[1]['error'] == 'restore-failed'
127129

0 commit comments

Comments
 (0)