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

Commit830146c

Browse files
committed
Apply review suggestions
1 parentd2ecba8 commit830146c

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

‎cli/exp_scaletest.go‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,7 +1707,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
17071707
Short:"Simulate notification delivery by creating many users listening to notifications.",
17081708
Handler:func(inv*serpent.Invocation)error {
17091709
ctx:=inv.Context()
1710-
client,err:=r.TryInitClient(inv)
1710+
client,err:=r.InitClient(inv)
17111711
iferr!=nil {
17121712
returnerr
17131713
}
@@ -1799,7 +1799,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
17991799
NotificationTimeout:notificationTimeout,
18001800
DialTimeout:dialTimeout,
18011801
DialBarrier:dialBarrier,
1802-
OwnerWatchBarrier:ownerWatchBarrier,
1802+
ReceivingWatchBarrier:ownerWatchBarrier,
18031803
ExpectedNotifications:expectedNotifications,
18041804
Metrics:metrics,
18051805
}
@@ -1813,12 +1813,12 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
18131813
User: createusers.Config{
18141814
OrganizationID:me.OrganizationIDs[0],
18151815
},
1816-
Roles: []string{},
1817-
NotificationTimeout:notificationTimeout,
1818-
DialTimeout:dialTimeout,
1819-
DialBarrier:dialBarrier,
1820-
OwnerWatchBarrier:ownerWatchBarrier,
1821-
Metrics:metrics,
1816+
Roles:[]string{},
1817+
NotificationTimeout:notificationTimeout,
1818+
DialTimeout:dialTimeout,
1819+
DialBarrier:dialBarrier,
1820+
ReceivingWatchBarrier:ownerWatchBarrier,
1821+
Metrics:metrics,
18221822
}
18231823
iferr:=config.Validate();err!=nil {
18241824
returnxerrors.Errorf("validate config: %w",err)
@@ -2183,7 +2183,6 @@ func triggerUserNotifications(
21832183
slog.F("email",triggerEmail),
21842184
slog.F("org_id",orgID))
21852185

2186-
createTime:=time.Now()
21872186
testUser,err:=client.CreateUserWithOrgs(ctx, codersdk.CreateUserRequestWithOrgs{
21882187
OrganizationIDs: []uuid.UUID{orgID},
21892188
Username:triggerUsername,
@@ -2194,15 +2193,14 @@ func triggerUserNotifications(
21942193
logger.Error(ctx,"create test user",slog.Error(err))
21952194
return
21962195
}
2197-
expectedNotifications[notificationsLib.TemplateUserAccountCreated]<-createTime
2196+
expectedNotifications[notificationsLib.TemplateUserAccountCreated]<-time.Now()
21982197

2199-
deleteTime:=time.Now()
22002198
err=client.DeleteUser(ctx,testUser.ID)
22012199
iferr!=nil {
22022200
logger.Error(ctx,"delete test user",slog.Error(err))
22032201
return
22042202
}
2205-
expectedNotifications[notificationsLib.TemplateUserAccountDeleted]<-deleteTime
2203+
expectedNotifications[notificationsLib.TemplateUserAccountDeleted]<-time.Now()
22062204
close(expectedNotifications[notificationsLib.TemplateUserAccountCreated])
22072205
close(expectedNotifications[notificationsLib.TemplateUserAccountDeleted])
22082206
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp