Skip to content

Commit 7bd8cda

Browse files
zylaclaude
andcommitted
Fix github-token-refresh test: remove illegal double snapshot call
The test was calling snapshot twice within a single task, which is illegal (snapshot writes to a single IORef that can only hold one value). Fixed by removing the second snapshot call and relying on the automatic final status update when the task completes. Test flow now: 1. snapshot posts "pending" status (creates and caches token) 2. Task sleeps 3 seconds (token expires after 2 seconds) 3. Task completes, final "success" status is posted automatically (detects expired cached token and refreshes it) This properly tests token refresh while following the one-snapshot-per-task rule. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent effcdcd commit 7bd8cda

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
-- output:
2-
[mytask] stdout | First status update done
3-
[mytask] stdout | Second status update done (token refreshed)
2+
[mytask] stdout | Task started, pending status posted
3+
[mytask] stdout | Task finishing (token will be refreshed for final status)
44
-- github:
55
Requested access token for installation 123
6-
Requested access token for installation 123
7-
Updated commit status for fakeowner/fakerepo to {"context":"mytask","description":"not cached","state":"pending","target_url":null}
8-
Requested access token for installation 123
96
Updated commit status for fakeowner/fakerepo to {"context":"mytask","description":"not cached","state":"pending","target_url":null}
107
Requested access token for installation 123
11-
Requested access token for installation 123
128
Updated commit status for fakeowner/fakerepo to {"context":"mytask","description":null,"state":"success","target_url":null}

test/t/slow/github-token-refresh.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ git commit --allow-empty -q -m "Initial commit"
1010

1111
taskrunner -n mytask bash -e -c '
1212
snapshot -n --commit-status
13-
echo "First status update done"
13+
echo "Task started, pending status posted"
1414
sleep 3
15-
snapshot -n --commit-status
16-
echo "Second status update done (token refreshed)"
15+
echo "Task finishing (token will be refreshed for final status)"
1716
'

0 commit comments

Comments
 (0)