@@ -122,7 +122,8 @@ func TestUserActivityInsights_SanityCheck(t *testing.T) {
122
122
logger := slogtest .Make (t , nil )
123
123
client := coderdtest .New (t , & coderdtest.Options {
124
124
IncludeProvisionerDaemon : true ,
125
- AgentStatsRefreshInterval : time .Millisecond * 100 ,
125
+ AgentStatsRefreshInterval : time .Millisecond * 50 ,
126
+ DBRollupInterval : time .Millisecond * 100 ,
126
127
})
127
128
128
129
// Create two users, one that will appear in the report and another that
@@ -476,13 +477,14 @@ func TestTemplateInsights_Golden(t *testing.T) {
476
477
477
478
prepare := func (t * testing.T , templates []* testTemplate , users []* testUser , testData map [* testWorkspace ]testDataGen ) * codersdk.Client {
478
479
logger := slogtest .Make (t , & slogtest.Options {IgnoreErrors : false }).Leveled (slog .LevelDebug )
479
- db , pubsub := dbtestutil .NewDB (t )
480
+ db , pubsub := dbtestutil .NewDB (t , dbtestutil . WithDumpOnFailure () )
480
481
client := coderdtest .New (t , & coderdtest.Options {
481
482
Database : db ,
482
483
Pubsub : pubsub ,
483
484
Logger : & logger ,
484
485
IncludeProvisionerDaemon : true ,
485
486
AgentStatsRefreshInterval : time .Hour , // Not relevant for this test.
487
+ DBRollupInterval : 100 * time .Millisecond ,
486
488
})
487
489
firstUser := coderdtest .CreateFirstUser (t , client )
488
490
@@ -1202,6 +1204,9 @@ func TestTemplateInsights_Golden(t *testing.T) {
1202
1204
templates , users , testData := prepareFixtureAndTestData (t , tt .makeFixture , tt .makeTestData )
1203
1205
client := prepare (t , templates , users , testData )
1204
1206
1207
+ // TODO(mafredri): Remove the need for this.
1208
+ time .Sleep (3 * time .Second )
1209
+
1205
1210
for _ , req := range tt .requests {
1206
1211
req := req
1207
1212
t .Run (req .name , func (t * testing.T ) {
@@ -1390,6 +1395,7 @@ func TestUserActivityInsights_Golden(t *testing.T) {
1390
1395
Logger : & logger ,
1391
1396
IncludeProvisionerDaemon : true ,
1392
1397
AgentStatsRefreshInterval : time .Hour , // Not relevant for this test.
1398
+ DBRollupInterval : 100 * time .Millisecond ,
1393
1399
})
1394
1400
firstUser := coderdtest .CreateFirstUser (t , client )
1395
1401
@@ -1976,6 +1982,9 @@ func TestUserActivityInsights_Golden(t *testing.T) {
1976
1982
templates , users , testData := prepareFixtureAndTestData (t , tt .makeFixture , tt .makeTestData )
1977
1983
client := prepare (t , templates , users , testData )
1978
1984
1985
+ // TODO(mafredri): Remove the need for this.
1986
+ time .Sleep (3 * time .Second )
1987
+
1979
1988
for _ , req := range tt .requests {
1980
1989
req := req
1981
1990
t .Run (req .name , func (t * testing.T ) {
0 commit comments