@@ -33,14 +33,15 @@ import (
33
33
"github.com/coder/coder/v2/codersdk"
34
34
"github.com/coder/coder/v2/codersdk/workspacesdk"
35
35
"github.com/coder/coder/v2/scaletest/agentconn"
36
- "github.com/coder/coder/v2/scaletest/coderconnect "
36
+ "github.com/coder/coder/v2/scaletest/createusers "
37
37
"github.com/coder/coder/v2/scaletest/createworkspaces"
38
38
"github.com/coder/coder/v2/scaletest/dashboard"
39
39
"github.com/coder/coder/v2/scaletest/harness"
40
40
"github.com/coder/coder/v2/scaletest/loadtestutil"
41
41
"github.com/coder/coder/v2/scaletest/reconnectingpty"
42
42
"github.com/coder/coder/v2/scaletest/workspacebuild"
43
43
"github.com/coder/coder/v2/scaletest/workspacetraffic"
44
+ "github.com/coder/coder/v2/scaletest/workspaceupdates"
44
45
"github.com/coder/serpent"
45
46
)
46
47
@@ -57,7 +58,7 @@ func (r *RootCmd) scaletestCmd() *serpent.Command {
57
58
r .scaletestCleanup (),
58
59
r .scaletestDashboard (),
59
60
r .scaletestCreateWorkspaces (),
60
- r .scaletestCoderConnect (),
61
+ r .scaletestWorkspaceUpdates (),
61
62
r .scaletestWorkspaceTraffic (),
62
63
},
63
64
}
@@ -856,7 +857,7 @@ func (r *RootCmd) scaletestCreateWorkspaces() *serpent.Command {
856
857
return cmd
857
858
}
858
859
859
- func (r * RootCmd )scaletestCoderConnect ()* serpent.Command {
860
+ func (r * RootCmd )scaletestWorkspaceUpdates ()* serpent.Command {
860
861
var (
861
862
workspaceCount int64
862
863
powerUserWorkspaces int64
@@ -963,7 +964,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
963
964
tracer := tracerProvider .Tracer (scaletestTracerName )
964
965
965
966
reg := prometheus .NewRegistry ()
966
- metrics := coderconnect .NewMetrics (reg )
967
+ metrics := workspaceupdates .NewMetrics (reg )
967
968
968
969
logger := inv .Logger
969
970
prometheusSrvClose := ServeHandler (ctx ,logger ,promhttp .HandlerFor (reg , promhttp.HandlerOpts {}),prometheusFlags .Address ,"prometheus" )
@@ -981,13 +982,14 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
981
982
982
983
_ ,_ = fmt .Fprintln (inv .Stderr ,"Creating users..." )
983
984
984
- dialBarrier := harness .NewBarrier (int (powerUserCount + regularUserCount ))
985
+ dialBarrier := new (sync.WaitGroup )
986
+ dialBarrier .Add (int (powerUserCount + regularUserCount ))
985
987
986
- configs := make ([]coderconnect .Config ,0 ,powerUserCount + regularUserCount )
988
+ configs := make ([]workspaceupdates .Config ,0 ,powerUserCount + regularUserCount )
987
989
988
990
for i := int64 (0 );i < powerUserCount ;i ++ {
989
- config := coderconnect .Config {
990
- User :coderconnect. UserConfig {
991
+ config := workspaceupdates .Config {
992
+ User :createusers. Config {
991
993
OrganizationID :me .OrganizationIDs [0 ],
992
994
},
993
995
Workspace : workspacebuild.Config {
@@ -1002,7 +1004,6 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1002
1004
WorkspaceUpdatesTimeout :workspaceUpdatesTimeout ,
1003
1005
DialTimeout :dialTimeout ,
1004
1006
Metrics :metrics ,
1005
- NoCleanup :noCleanup ,
1006
1007
DialBarrier :dialBarrier ,
1007
1008
}
1008
1009
if err := config .Validate ();err != nil {
@@ -1013,8 +1014,8 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1013
1014
1014
1015
for i := int64 (0 );i < regularUserCount ;i ++ {
1015
1016
workspaceCount := 1
1016
- config := coderconnect .Config {
1017
- User :coderconnect. UserConfig {
1017
+ config := workspaceupdates .Config {
1018
+ User :createusers. Config {
1018
1019
OrganizationID :me .OrganizationIDs [0 ],
1019
1020
},
1020
1021
Workspace : workspacebuild.Config {
@@ -1029,7 +1030,6 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1029
1030
WorkspaceUpdatesTimeout :workspaceUpdatesTimeout ,
1030
1031
DialTimeout :dialTimeout ,
1031
1032
Metrics :metrics ,
1032
- NoCleanup :noCleanup ,
1033
1033
DialBarrier :dialBarrier ,
1034
1034
}
1035
1035
if err := config .Validate ();err != nil {
@@ -1040,7 +1040,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1040
1040
1041
1041
th := harness .NewTestHarness (strategy .toStrategy (),cleanupStrategy .toStrategy ())
1042
1042
for i ,config := range configs {
1043
- name := fmt .Sprintf ("coderconnect -%dw" ,config .WorkspaceCount )
1043
+ name := fmt .Sprintf ("workspaceupdates -%dw" ,config .WorkspaceCount )
1044
1044
id := strconv .Itoa (i )
1045
1045
username ,email ,err := loadtestutil .GenerateUserIdentifier (id )
1046
1046
if err != nil {
@@ -1049,7 +1049,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1049
1049
config .User .Username = username
1050
1050
config .User .Email = email
1051
1051
1052
- var runner harness.Runnable = coderconnect .NewRunner (client ,config )
1052
+ var runner harness.Runnable = workspaceupdates .NewRunner (client ,config )
1053
1053
if tracingEnabled {
1054
1054
runner = & runnableTraceWrapper {
1055
1055
tracer :tracer ,
@@ -1061,7 +1061,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1061
1061
th .AddRun (name ,id ,runner )
1062
1062
}
1063
1063
1064
- _ ,_ = fmt .Fprintln (inv .Stderr ,"RunningCoder Connect scaletest..." )
1064
+ _ ,_ = fmt .Fprintln (inv .Stderr ,"Runningworkspace updates scaletest..." )
1065
1065
testCtx ,testCancel := strategy .toContext (ctx )
1066
1066
defer testCancel ()
1067
1067
err = th .Run (testCtx )
@@ -1082,12 +1082,14 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1082
1082
}
1083
1083
}
1084
1084
1085
- _ ,_ = fmt .Fprintln (inv .Stderr ,"\n Cleaning up..." )
1086
- cleanupCtx ,cleanupCancel := cleanupStrategy .toContext (ctx )
1087
- defer cleanupCancel ()
1088
- err = th .Cleanup (cleanupCtx )
1089
- if err != nil {
1090
- return xerrors .Errorf ("cleanup tests: %w" ,err )
1085
+ if ! noCleanup {
1086
+ _ ,_ = fmt .Fprintln (inv .Stderr ,"\n Cleaning up..." )
1087
+ cleanupCtx ,cleanupCancel := cleanupStrategy .toContext (ctx )
1088
+ defer cleanupCancel ()
1089
+ err = th .Cleanup (cleanupCtx )
1090
+ if err != nil {
1091
+ return xerrors .Errorf ("cleanup tests: %w" ,err )
1092
+ }
1091
1093
}
1092
1094
1093
1095
if res .TotalFail > 0 {
@@ -1131,7 +1133,7 @@ func (r *RootCmd) scaletestCoderConnect() *serpent.Command {
1131
1133
Flag :"dial-timeout" ,
1132
1134
Env :"CODER_SCALETEST_DIAL_TIMEOUT" ,
1133
1135
Default :"2m" ,
1134
- Description :"Timeout for dialing theCoder Connect endpoint." ,
1136
+ Description :"Timeout for dialing thetailnet endpoint." ,
1135
1137
Value :serpent .DurationOf (& dialTimeout ),
1136
1138
},
1137
1139
{