提交记录修改internal/mobilelink/link_test.go+7 −0看文件
| @@ -405,6 +405,13 @@ func TestSavedNativeClientUsesNewRoomsAndChecksHostIdentity(t *testing.T) { | ||
| 405 | 405 | for _, expectedPin := range []string{other.Pin, f.identity.Pin, f.identity.Pin} { |
| 406 | 406 | ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) |
| 407 | 407 | inv, err := mobilelink.CreateDiscoverableRoom(ctx, f.base, strings.Repeat("t", 64), lookup) |
| 408 | 新增: // The host connection can finish before the relay retires its room. | |
| 409 | 新增: // Saved hosts back off on this transient conflict too; the occupied-room | |
| 410 | 新增: // assertion below must still reject displacement without retrying. | |
| 411 | 新增: for previous != "" && err != nil && mobilelink.Retryable(err) && ctx.Err() == nil { | |
| 412 | 新增: time.Sleep(10 * time.Millisecond) | |
| 413 | 新增: inv, err = mobilelink.CreateDiscoverableRoom(ctx, f.base, strings.Repeat("t", 64), lookup) | |
| 414 | 新增: } | |
| 408 | 415 | if err != nil { |
| 409 | 416 | cancel() |
| 410 | 417 | t.Fatal(err) |

