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

Commit4f0339c

Browse files
committed
Apply review suggestions
1 parent241c3b8 commit4f0339c

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
@@ -1942,7 +1942,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
19421942
Short:"Simulate notification delivery by creating many users listening to notifications.",
19431943
Handler:func(inv*serpent.Invocation)error {
19441944
ctx:=inv.Context()
1945-
client,err:=r.TryInitClient(inv)
1945+
client,err:=r.InitClient(inv)
19461946
iferr!=nil {
19471947
returnerr
19481948
}
@@ -2034,7 +2034,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
20342034
NotificationTimeout:notificationTimeout,
20352035
DialTimeout:dialTimeout,
20362036
DialBarrier:dialBarrier,
2037-
OwnerWatchBarrier:ownerWatchBarrier,
2037+
ReceivingWatchBarrier:ownerWatchBarrier,
20382038
ExpectedNotifications:expectedNotifications,
20392039
Metrics:metrics,
20402040
}
@@ -2048,12 +2048,12 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
20482048
User: createusers.Config{
20492049
OrganizationID:me.OrganizationIDs[0],
20502050
},
2051-
Roles: []string{},
2052-
NotificationTimeout:notificationTimeout,
2053-
DialTimeout:dialTimeout,
2054-
DialBarrier:dialBarrier,
2055-
OwnerWatchBarrier:ownerWatchBarrier,
2056-
Metrics:metrics,
2051+
Roles:[]string{},
2052+
NotificationTimeout:notificationTimeout,
2053+
DialTimeout:dialTimeout,
2054+
DialBarrier:dialBarrier,
2055+
ReceivingWatchBarrier:ownerWatchBarrier,
2056+
Metrics:metrics,
20572057
}
20582058
iferr:=config.Validate();err!=nil {
20592059
returnxerrors.Errorf("validate config: %w",err)
@@ -2418,7 +2418,6 @@ func triggerUserNotifications(
24182418
slog.F("email",triggerEmail),
24192419
slog.F("org_id",orgID))
24202420

2421-
createTime:=time.Now()
24222421
testUser,err:=client.CreateUserWithOrgs(ctx, codersdk.CreateUserRequestWithOrgs{
24232422
OrganizationIDs: []uuid.UUID{orgID},
24242423
Username:triggerUsername,
@@ -2429,15 +2428,14 @@ func triggerUserNotifications(
24292428
logger.Error(ctx,"create test user",slog.Error(err))
24302429
return
24312430
}
2432-
expectedNotifications[notificationsLib.TemplateUserAccountCreated]<-createTime
2431+
expectedNotifications[notificationsLib.TemplateUserAccountCreated]<-time.Now()
24332432

2434-
deleteTime:=time.Now()
24352433
err=client.DeleteUser(ctx,testUser.ID)
24362434
iferr!=nil {
24372435
logger.Error(ctx,"delete test user",slog.Error(err))
24382436
return
24392437
}
2440-
expectedNotifications[notificationsLib.TemplateUserAccountDeleted]<-deleteTime
2438+
expectedNotifications[notificationsLib.TemplateUserAccountDeleted]<-time.Now()
24412439
close(expectedNotifications[notificationsLib.TemplateUserAccountCreated])
24422440
close(expectedNotifications[notificationsLib.TemplateUserAccountDeleted])
24432441
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp