Reduce test logs (#2550)

This commit is contained in:
Maycon Santos 2024-09-06 16:28:19 +02:00 committed by GitHub
parent fcf150f704
commit a7e46bf7b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 33 additions and 27 deletions

View File

@ -1276,6 +1276,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er
ID: peer1ID,
Key: peer1Key,
Name: "test-host1@netbird.io",
DNSLabel: "test-host1",
UserID: userID,
Meta: nbpeer.PeerSystemMeta{
Hostname: "test-host1@netbird.io",
@ -1302,6 +1303,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er
ID: peer2ID,
Key: peer2Key,
Name: "test-host2@netbird.io",
DNSLabel: "test-host2",
UserID: userID,
Meta: nbpeer.PeerSystemMeta{
Hostname: "test-host2@netbird.io",
@ -1328,6 +1330,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er
ID: peer3ID,
Key: peer3Key,
Name: "test-host3@netbird.io",
DNSLabel: "test-host3",
UserID: userID,
Meta: nbpeer.PeerSystemMeta{
Hostname: "test-host3@netbird.io",
@ -1354,6 +1357,7 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er
ID: peer4ID,
Key: peer4Key,
Name: "test-host4@netbird.io",
DNSLabel: "test-host4",
UserID: userID,
Meta: nbpeer.PeerSystemMeta{
Hostname: "test-host4@netbird.io",
@ -1379,10 +1383,11 @@ func initTestRouteAccount(t *testing.T, am *DefaultAccountManager) (*Account, er
IP: peer5IP,
ID: peer5ID,
Key: peer5Key,
Name: "test-host4@netbird.io",
Name: "test-host5@netbird.io",
DNSLabel: "test-host5",
UserID: userID,
Meta: nbpeer.PeerSystemMeta{
Hostname: "test-host4@netbird.io",
Hostname: "test-host5@netbird.io",
GoOS: "linux",
Kernel: "Linux",
Core: "21.04",

View File

@ -63,6 +63,7 @@ func TestScheduler_Cancel(t *testing.T) {
scheduler.Schedule(context.Background(), scheduletime, jobID2, func() (nextRunIn time.Duration, reschedule bool) {
return scheduletime, true
})
defer scheduler.Cancel(context.Background(), []string{jobID2})
time.Sleep(sleepTime)
assert.Len(t, scheduler.jobs, 2)

View File

@ -55,7 +55,7 @@ func (p *PeersUpdateManager) SendUpdate(ctx context.Context, peerID string, upda
log.WithContext(ctx).Debugf("update was sent to channel for peer %s", peerID)
default:
dropped = true
log.WithContext(ctx).Warnf("channel for peer %s is %d full", peerID, len(channel))
log.WithContext(ctx).Warnf("channel for peer %s is %d full or closed", peerID, len(channel))
}
} else {
log.WithContext(ctx).Debugf("peer %s has no channel", peerID)