Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfbabb43

Browse files
authored
fix: ignore spurious node updates while waiting for errors (#10175)
fixes#9921
1 parentb0d2828 commitfbabb43

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

‎enterprise/tailnet/pgcoord_test.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -645,12 +645,20 @@ func (c *testConn) recvNodes(ctx context.Context, t *testing.T) []*agpl.Node {
645645

646646
func (c*testConn)recvErr(ctx context.Context,t*testing.T)error {
647647
t.Helper()
648-
select {
649-
case<-ctx.Done():
650-
t.Fatal("timeout receiving error")
651-
returnctx.Err()
652-
caseerr:=<-c.errChan:
653-
returnerr
648+
// pgCoord works on eventual consistency, so it sometimes sends extra node
649+
// updates, and these block errors if not read from the nodes channel.
650+
for {
651+
select {
652+
casenodes:=<-c.nodeChan:
653+
t.Logf("ignoring nodes update while waiting for error; id=%s, nodes=%+v",
654+
c.id.String(),nodes)
655+
continue
656+
case<-ctx.Done():
657+
t.Fatal("timeout receiving error")
658+
returnctx.Err()
659+
caseerr:=<-c.errChan:
660+
returnerr
661+
}
654662
}
655663
}
656664

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp