test(daemon): match node names on the NAME column, not anywhere in the table #739
Dismiss Review
Are you sure you want to dismiss this review?
Labels
Clear labels
accessibility
all-platforms
area:agents
area:ai
area:chain
area:ci
area:client
area:daemon
area:p2p
area:project
area:protocol
area:runtime
area:storage
bug
chore
community
dependencies
discussion
discussion/Announcements
discussion/General
discussion/Ideas
discussion/Q&A
discussion/Show and tell
discussion/answered
documentation
duplicate
enhancement
good first issue
help wanted
i18n
infra
invalid
needs:decision
needs:hardware
paired
question
research
security
status:in-review
test
testing
tracking
wontfix
Barrier affecting people with disabilities
Run every platform's packaging and checks on this pull request, not only the three main ones
MCP server, skill, and thinking on the pool
Planner and model providers
Blockchain, SISY, verification
Continuous integration and build workflows
Desktop and web clients
sisyphusd coordinator, worker, scheduler
libp2p hosts, relays, discovery, connections between nodes
Project planning, roadmap, and governance
Protobuf schemas and RPC contracts
Workload execution and environments
Content-addressed storage, IPFS, Kubo, Cluster, S3, names, pinning
Something isn't working
Repository health, templates, Discussions, contributor experience
Updates to actions, Go modules or npm packages
Migrated from GitHub Discussions
GitHub Discussions category: Announcements
GitHub Discussions category: General
GitHub Discussions category: Ideas
GitHub Discussions category: Q&A
GitHub Discussions category: Show and tell
Q&A discussion with an accepted answer
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
Translations and right-to-left layouts
Build, CI, releases
This doesn't seem right
Waits on a decision from both owners
Waits on a machine we do not have yet
Built together by both maintainers, with co-authored commits
Further information is requested
Needs investigation or a design decision
Sealing, keys, access control, tokens, the security model
Built and in an open pull request; closes when it merges
Tests, test harnesses and the rehearsal
Roadmap and meta issues
This will not be worked on
type
Feature
A request, idea, or new functionality (GitHub issue type)
type
Task
A specific piece of work (GitHub issue type)
Milestone
No items
No Milestone
V0: prove the loop
Projects
Clear projects
No projects
Sisyphus roadmap
Done
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Sisyphus/Sisyphus#739
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #738.
What failed
TestTrustInOneDirectionOnlyfailed on #734, which doesn't touch the daemon. The test checksstrings.Contains(out, "rig")against the laptop'snodestable. The laptop's own random peer ID containedrig(…VqVrigez…), so the check fired even though the rig had no row.Fix
listsNode(table, name)that only looks at the NAME column of each row.nodesoutput:reciprocal_test.go: "the rig is not working for the laptop".cli_test.go: "the coordinator-onlybossdoesn't appear as a worker".bossis all base58 characters too, so it had the same flaw.Names containing
lorO(such aslaptop) can't occur inside a base58 ID, so the other checks are safe and stay as they are.Testing
go test -run … -v).gofmtandgo vetare clean.listsNodeis right: it compares only the first field of each row, so a header line or a peer ID can't match. Both call sites read correctly.There's one more check in the same file with the same flaw, in
TestNodesThatTrustEachOtherWorkForEachOther(aroundreciprocal_test.go:793, after the laptop withdraws its trust):workersisnodes --addr. If the laptop's random peer ID containsrig, the condition can never be true, and the test times out the same way #738 failed.laptopis safe becauselisn't in base58, so only therighalf needslistsNode. Thestrings.Contains(out, "laptop")at :761 is also fine for the same reason.The positive waits (
waitForOutput(t, "rig", "nodes", ...)at :776, and"hand"incli_test.go) can pass too early on a peer-ID match, but they don't fail. The later checks would catch a missing row, so I'd leave them as they are.Austin spotted one more vulnerable negative check in
TestNodesThatTrustEachOtherWorkForEachOther, aroundreciprocal_test.go:793:The
"rig"substring can also occur inside the laptop peer ID there, makingwaitFortime out. Could this PR replace that half with!listsNode(workers(laptop), "rig")as well? Thelaptopcheck is safe becauselis not in base58. /cc @rvnminers-A-and-NThanks for merging. The
"rig"half atreciprocal_test.go:793(TestNodesThatTrustEachOtherWorkForEachOther) is still a substring check ondevat3123a9d:Want me to open a one-line follow-up switching it to
!listsNode(workers(laptop), "rig")? Or are you already on it?Austin, I’ll take the one-line follow-up; no need for you to open it. I’ll reopen #738 with the remaining call site, make the focused test-only PR, and request your review. /cc @rvnminers-A-and-N