@@ -1707,7 +1707,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
1707
1707
Short :"Simulate notification delivery by creating many users listening to notifications." ,
1708
1708
Handler :func (inv * serpent.Invocation )error {
1709
1709
ctx := inv .Context ()
1710
- client ,err := r .TryInitClient (inv )
1710
+ client ,err := r .InitClient (inv )
1711
1711
if err != nil {
1712
1712
return err
1713
1713
}
@@ -1799,7 +1799,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
1799
1799
NotificationTimeout :notificationTimeout ,
1800
1800
DialTimeout :dialTimeout ,
1801
1801
DialBarrier :dialBarrier ,
1802
- OwnerWatchBarrier : ownerWatchBarrier ,
1802
+ ReceivingWatchBarrier : ownerWatchBarrier ,
1803
1803
ExpectedNotifications :expectedNotifications ,
1804
1804
Metrics :metrics ,
1805
1805
}
@@ -1813,12 +1813,12 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
1813
1813
User : createusers.Config {
1814
1814
OrganizationID :me .OrganizationIDs [0 ],
1815
1815
},
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 ,
1822
1822
}
1823
1823
if err := config .Validate ();err != nil {
1824
1824
return xerrors .Errorf ("validate config: %w" ,err )
@@ -2183,7 +2183,6 @@ func triggerUserNotifications(
2183
2183
slog .F ("email" ,triggerEmail ),
2184
2184
slog .F ("org_id" ,orgID ))
2185
2185
2186
- createTime := time .Now ()
2187
2186
testUser ,err := client .CreateUserWithOrgs (ctx , codersdk.CreateUserRequestWithOrgs {
2188
2187
OrganizationIDs : []uuid.UUID {orgID },
2189
2188
Username :triggerUsername ,
@@ -2194,15 +2193,14 @@ func triggerUserNotifications(
2194
2193
logger .Error (ctx ,"create test user" ,slog .Error (err ))
2195
2194
return
2196
2195
}
2197
- expectedNotifications [notificationsLib .TemplateUserAccountCreated ]<- createTime
2196
+ expectedNotifications [notificationsLib .TemplateUserAccountCreated ]<- time . Now ()
2198
2197
2199
- deleteTime := time .Now ()
2200
2198
err = client .DeleteUser (ctx ,testUser .ID )
2201
2199
if err != nil {
2202
2200
logger .Error (ctx ,"delete test user" ,slog .Error (err ))
2203
2201
return
2204
2202
}
2205
- expectedNotifications [notificationsLib .TemplateUserAccountDeleted ]<- deleteTime
2203
+ expectedNotifications [notificationsLib .TemplateUserAccountDeleted ]<- time . Now ()
2206
2204
close (expectedNotifications [notificationsLib .TemplateUserAccountCreated ])
2207
2205
close (expectedNotifications [notificationsLib .TemplateUserAccountDeleted ])
2208
2206
}