@@ -1942,7 +1942,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
1942
1942
Short :"Simulate notification delivery by creating many users listening to notifications." ,
1943
1943
Handler :func (inv * serpent.Invocation )error {
1944
1944
ctx := inv .Context ()
1945
- client ,err := r .TryInitClient (inv )
1945
+ client ,err := r .InitClient (inv )
1946
1946
if err != nil {
1947
1947
return err
1948
1948
}
@@ -2034,7 +2034,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
2034
2034
NotificationTimeout :notificationTimeout ,
2035
2035
DialTimeout :dialTimeout ,
2036
2036
DialBarrier :dialBarrier ,
2037
- OwnerWatchBarrier : ownerWatchBarrier ,
2037
+ ReceivingWatchBarrier : ownerWatchBarrier ,
2038
2038
ExpectedNotifications :expectedNotifications ,
2039
2039
Metrics :metrics ,
2040
2040
}
@@ -2048,12 +2048,12 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
2048
2048
User : createusers.Config {
2049
2049
OrganizationID :me .OrganizationIDs [0 ],
2050
2050
},
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 ,
2057
2057
}
2058
2058
if err := config .Validate ();err != nil {
2059
2059
return xerrors .Errorf ("validate config: %w" ,err )
@@ -2418,7 +2418,6 @@ func triggerUserNotifications(
2418
2418
slog .F ("email" ,triggerEmail ),
2419
2419
slog .F ("org_id" ,orgID ))
2420
2420
2421
- createTime := time .Now ()
2422
2421
testUser ,err := client .CreateUserWithOrgs (ctx , codersdk.CreateUserRequestWithOrgs {
2423
2422
OrganizationIDs : []uuid.UUID {orgID },
2424
2423
Username :triggerUsername ,
@@ -2429,15 +2428,14 @@ func triggerUserNotifications(
2429
2428
logger .Error (ctx ,"create test user" ,slog .Error (err ))
2430
2429
return
2431
2430
}
2432
- expectedNotifications [notificationsLib .TemplateUserAccountCreated ]<- createTime
2431
+ expectedNotifications [notificationsLib .TemplateUserAccountCreated ]<- time . Now ()
2433
2432
2434
- deleteTime := time .Now ()
2435
2433
err = client .DeleteUser (ctx ,testUser .ID )
2436
2434
if err != nil {
2437
2435
logger .Error (ctx ,"delete test user" ,slog .Error (err ))
2438
2436
return
2439
2437
}
2440
- expectedNotifications [notificationsLib .TemplateUserAccountDeleted ]<- deleteTime
2438
+ expectedNotifications [notificationsLib .TemplateUserAccountDeleted ]<- time . Now ()
2441
2439
close (expectedNotifications [notificationsLib .TemplateUserAccountCreated ])
2442
2440
close (expectedNotifications [notificationsLib .TemplateUserAccountDeleted ])
2443
2441
}