@@ -520,8 +520,8 @@ func TestEntitlements(t *testing.T) {
520520t .Run ("Premium" ,func (t * testing.T ) {
521521t .Parallel ()
522522const userLimit = 1
523- const expectedAgentSoftLimit = 800 * userLimit
524- const expectedAgentHardLimit = 1000 * userLimit
523+ const expectedAgentSoftLimit = 1000
524+ const expectedAgentHardLimit = 1000
525525
526526db ,_ := dbtestutil .NewDB (t )
527527licenseOptions := coderdenttest.LicenseOptions {
@@ -530,9 +530,7 @@ func TestEntitlements(t *testing.T) {
530530ExpiresAt :dbtime .Now ().Add (time .Hour * 24 * 2 ),
531531FeatureSet :codersdk .FeatureSetPremium ,
532532Features : license.Features {
533- // Temporary: allows the default value for the
534- // managed_agent_limit feature to be used.
535- codersdk .FeatureUserLimit :1 ,
533+ codersdk .FeatureUserLimit :userLimit ,
536534},
537535}
538536_ ,err := db .InsertLicense (context .Background (), database.InsertLicenseParams {
@@ -557,11 +555,15 @@ func TestEntitlements(t *testing.T) {
557555require .Equal (t ,codersdk .EntitlementEntitled ,agentEntitlement .Entitlement )
558556require .EqualValues (t ,expectedAgentSoftLimit ,* agentEntitlement .SoftLimit )
559557require .EqualValues (t ,expectedAgentHardLimit ,* agentEntitlement .Limit )
558+
560559// This might be shocking, but there's a sound reason for this.
561560// See license.go for more details.
562- require .Equal (t ,time .Date (2025 ,7 ,1 ,0 ,0 ,0 ,0 ,time .UTC ),agentEntitlement .UsagePeriod .IssuedAt )
563- require .WithinDuration (t ,licenseOptions .NotBefore ,agentEntitlement .UsagePeriod .Start ,time .Second )
564- require .WithinDuration (t ,licenseOptions .ExpiresAt ,agentEntitlement .UsagePeriod .End ,time .Second )
561+ agentUsagePeriodIssuedAt := time .Date (2025 ,7 ,1 ,0 ,0 ,0 ,0 ,time .UTC )
562+ agentUsagePeriodStart := agentUsagePeriodIssuedAt
563+ agentUsagePeriodEnd := agentUsagePeriodStart .AddDate (100 ,0 ,0 )
564+ require .Equal (t ,agentUsagePeriodIssuedAt ,agentEntitlement .UsagePeriod .IssuedAt )
565+ require .WithinDuration (t ,agentUsagePeriodStart ,agentEntitlement .UsagePeriod .Start ,time .Second )
566+ require .WithinDuration (t ,agentUsagePeriodEnd ,agentEntitlement .UsagePeriod .End ,time .Second )
565567continue
566568}
567569
@@ -1496,14 +1498,14 @@ func TestManagedAgentLimitDefault(t *testing.T) {
14961498})
14971499
14981500// "Premium" licenses should receive a default managed agent limit of:
1499- // soft =800 * user_limit
1500- // hard = 1000 * user_limit
1501+ // soft =1000
1502+ // hard = 1000
15011503t .Run ("Premium" ,func (t * testing.T ) {
15021504t .Parallel ()
15031505
1504- const userLimit = 100
1505- const softLimit = 800 * userLimit
1506- const hardLimit = 1000 * userLimit
1506+ const userLimit = 33
1507+ const softLimit = 1000
1508+ const hardLimit = 1000
15071509lic := database.License {
15081510ID :1 ,
15091511UploadedAt :time .Now (),