Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
chore: upgrade .NET 11 RC1 dependencies
CI 上 S3 的三个下载用例红了:Download_HeadDenied_StillDownloadsViaGet、
Download_DirectReadDenied_FallsBackToPresignedUrl、Download_ResumesWithRangeRequest。
下载本身是对的 —— 写出去的字节与远端完全一致,错的是断言那一行:
Assert.AreSequenceEqual(content, await File.ReadAllBytesAsync(local));
本仓库跑 net11.0 + LangVersion preview(C# first-class span),`content` 这个
byte[] 实参会先隐式转成 ReadOnlySpan<byte>,然后才在第二个实参的 await 处挂起。
span 是 ref struct,跨不了挂起点 —— 恢复之后拿到的是空 span,断言于是无条件失败。
编译器不报错也不告警,且只在 await 真正异步完成时才现形,所以表现成
「单跑绿、一起跑红」的假不稳定(本地 4 个红、CI 3 个红,就是这么来的)。
改法是把 await 先落到局部变量再断言。同一个坑在 Redis 测试里还有 5 处
(RedisStoreTests 4 处、RedisPanelEditingUiTests 1 处),一并改掉 ——
那几条眼下靠 await 同步完成侥幸没炸,是颗定时炸弹。
顺带回滚 92bf4eb 里按错误猜测(以为是缓冲区被复用)加的防御性拷贝与注释:
LoopbackS3Server 用的是裸 TcpListener,注释里说的 HttpListener 并不存在。
规则写进 AGENTS.md:任何 span 接收者或 span 实参的调用,实参列表里不许出现 await。
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019gsr3Qyjd4uQY1MJ9mVYen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.