Skip to content

Commit ec6ec2f

Browse files
committed
Fixed tests and made them less loggy
1 parent 8778403 commit ec6ec2f

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed

apps/webapp/test/runsReplicationService.part1.test.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ClickHouse } from "@internal/clickhouse";
22
import { containerTest } from "@internal/testcontainers";
3-
import { Logger } from "@trigger.dev/core/logger";
43
import { setTimeout } from "node:timers/promises";
54
import { z } from "zod";
65
import { TaskRunStatus } from "~/database-types";
@@ -22,6 +21,7 @@ describe("RunsReplicationService (part 1/2)", () => {
2221
compression: {
2322
request: true,
2423
},
24+
logLevel: "warn",
2525
});
2626

2727
const { tracer, exporter } = createInMemoryTracing();
@@ -40,6 +40,7 @@ describe("RunsReplicationService (part 1/2)", () => {
4040
leaderLockExtendIntervalMs: 1000,
4141
ackIntervalSeconds: 5,
4242
tracer,
43+
logLevel: "warn",
4344
});
4445

4546
await runsReplicationService.start();
@@ -135,6 +136,7 @@ describe("RunsReplicationService (part 1/2)", () => {
135136
compression: {
136137
request: true,
137138
},
139+
logLevel: "warn",
138140
});
139141

140142
const { tracer, exporter } = createInMemoryTracing();
@@ -153,6 +155,7 @@ describe("RunsReplicationService (part 1/2)", () => {
153155
leaderLockExtendIntervalMs: 1000,
154156
ackIntervalSeconds: 5,
155157
tracer,
158+
logLevel: "warn",
156159
});
157160

158161
await runsReplicationService.start();
@@ -271,6 +274,7 @@ describe("RunsReplicationService (part 1/2)", () => {
271274
const clickhouse = new ClickHouse({
272275
url: clickhouseContainer.getConnectionUrl(),
273276
name: "runs-replication",
277+
logLevel: "warn",
274278
});
275279

276280
const { tracer, exporter } = createInMemoryTracing();
@@ -289,6 +293,7 @@ describe("RunsReplicationService (part 1/2)", () => {
289293
leaderLockExtendIntervalMs: 1000,
290294
ackIntervalSeconds: 5,
291295
tracer,
296+
logLevel: "warn",
292297
});
293298

294299
await runsReplicationService.start();
@@ -341,6 +346,7 @@ describe("RunsReplicationService (part 1/2)", () => {
341346
const clickhouse = new ClickHouse({
342347
url: clickhouseContainer.getConnectionUrl(),
343348
name: "runs-replication-batching",
349+
logLevel: "warn",
344350
});
345351

346352
const runsReplicationService = new RunsReplicationService({
@@ -356,6 +362,7 @@ describe("RunsReplicationService (part 1/2)", () => {
356362
leaderLockTimeoutMs: 5000,
357363
leaderLockExtendIntervalMs: 1000,
358364
ackIntervalSeconds: 5,
365+
logLevel: "warn",
359366
});
360367

361368
await runsReplicationService.start();
@@ -443,6 +450,7 @@ describe("RunsReplicationService (part 1/2)", () => {
443450
const clickhouse = new ClickHouse({
444451
url: clickhouseContainer.getConnectionUrl(),
445452
name: "runs-replication-payload",
453+
logLevel: "warn",
446454
});
447455

448456
const runsReplicationService = new RunsReplicationService({
@@ -458,6 +466,7 @@ describe("RunsReplicationService (part 1/2)", () => {
458466
leaderLockTimeoutMs: 5000,
459467
leaderLockExtendIntervalMs: 1000,
460468
ackIntervalSeconds: 5,
469+
logLevel: "warn",
461470
});
462471

463472
await runsReplicationService.start();
@@ -542,6 +551,7 @@ describe("RunsReplicationService (part 1/2)", () => {
542551
const clickhouse = new ClickHouse({
543552
url: clickhouseContainer.getConnectionUrl(),
544553
name: "runs-replication-payload",
554+
logLevel: "warn",
545555
});
546556

547557
const runsReplicationService = new RunsReplicationService({
@@ -557,6 +567,7 @@ describe("RunsReplicationService (part 1/2)", () => {
557567
leaderLockTimeoutMs: 5000,
558568
leaderLockExtendIntervalMs: 1000,
559569
ackIntervalSeconds: 5,
570+
logLevel: "warn",
560571
});
561572

562573
await runsReplicationService.start();
@@ -646,6 +657,7 @@ describe("RunsReplicationService (part 1/2)", () => {
646657
const clickhouse = new ClickHouse({
647658
url: clickhouseContainer.getConnectionUrl(),
648659
name: "runs-replication-update",
660+
logLevel: "warn",
649661
});
650662

651663
const runsReplicationService = new RunsReplicationService({
@@ -661,6 +673,7 @@ describe("RunsReplicationService (part 1/2)", () => {
661673
leaderLockTimeoutMs: 5000,
662674
leaderLockExtendIntervalMs: 1000,
663675
ackIntervalSeconds: 5,
676+
logLevel: "warn",
664677
});
665678

666679
await runsReplicationService.start();
@@ -751,6 +764,7 @@ describe("RunsReplicationService (part 1/2)", () => {
751764
const clickhouse = new ClickHouse({
752765
url: clickhouseContainer.getConnectionUrl(),
753766
name: "runs-replication-delete",
767+
logLevel: "warn",
754768
});
755769

756770
const runsReplicationService = new RunsReplicationService({
@@ -766,6 +780,7 @@ describe("RunsReplicationService (part 1/2)", () => {
766780
leaderLockTimeoutMs: 5000,
767781
leaderLockExtendIntervalMs: 1000,
768782
ackIntervalSeconds: 5,
783+
logLevel: "warn",
769784
});
770785

771786
await runsReplicationService.start();
@@ -849,6 +864,7 @@ describe("RunsReplicationService (part 1/2)", () => {
849864
const clickhouse = new ClickHouse({
850865
url: clickhouseContainer.getConnectionUrl(),
851866
name: "runs-replication-shutdown-handover",
867+
logLevel: "warn",
852868
});
853869

854870
// Service A
@@ -865,6 +881,7 @@ describe("RunsReplicationService (part 1/2)", () => {
865881
leaderLockTimeoutMs: 5000,
866882
leaderLockExtendIntervalMs: 1000,
867883
ackIntervalSeconds: 5,
884+
logLevel: "warn",
868885
});
869886

870887
await runsReplicationServiceA.start();
@@ -968,6 +985,7 @@ describe("RunsReplicationService (part 1/2)", () => {
968985
leaderLockTimeoutMs: 5000,
969986
leaderLockExtendIntervalMs: 1000,
970987
ackIntervalSeconds: 5,
988+
logLevel: "warn",
971989
});
972990

973991
await runsReplicationServiceB.start();
@@ -997,6 +1015,7 @@ describe("RunsReplicationService (part 1/2)", () => {
9971015
const clickhouse = new ClickHouse({
9981016
url: clickhouseContainer.getConnectionUrl(),
9991017
name: "runs-replication-shutdown-after-processed",
1018+
logLevel: "warn",
10001019
});
10011020

10021021
// Service A
@@ -1013,6 +1032,7 @@ describe("RunsReplicationService (part 1/2)", () => {
10131032
leaderLockTimeoutMs: 5000,
10141033
leaderLockExtendIntervalMs: 1000,
10151034
ackIntervalSeconds: 5,
1035+
logLevel: "warn",
10161036
});
10171037

10181038
await runsReplicationServiceA.start();
@@ -1114,6 +1134,7 @@ describe("RunsReplicationService (part 1/2)", () => {
11141134
leaderLockTimeoutMs: 5000,
11151135
leaderLockExtendIntervalMs: 1000,
11161136
ackIntervalSeconds: 5,
1137+
logLevel: "warn",
11171138
});
11181139

11191140
await runsReplicationServiceB.start();
@@ -1137,6 +1158,7 @@ describe("RunsReplicationService (part 1/2)", () => {
11371158
const clickhouse = new ClickHouse({
11381159
url: clickhouseContainer.getConnectionUrl(),
11391160
name: "runs-replication-metrics",
1161+
logLevel: "warn",
11401162
});
11411163

11421164
const { tracer } = createInMemoryTracing();
@@ -1157,6 +1179,7 @@ describe("RunsReplicationService (part 1/2)", () => {
11571179
ackIntervalSeconds: 5,
11581180
tracer,
11591181
meter: metricsHelper.meter,
1182+
logLevel: "warn",
11601183
});
11611184

11621185
await runsReplicationService.start();

apps/webapp/test/runsReplicationService.part2.test.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ describe("RunsReplicationService (part 2/2)", () => {
1818
const clickhouse = new ClickHouse({
1919
url: clickhouseContainer.getConnectionUrl(),
2020
name: "runs-replication-shutdown-handover",
21+
logLevel: "warn",
2122
});
2223

2324
// Service A
@@ -35,7 +36,7 @@ describe("RunsReplicationService (part 2/2)", () => {
3536
leaderLockExtendIntervalMs: 1000,
3637
leaderLockAcquireAdditionalTimeMs: 10_000,
3738
ackIntervalSeconds: 5,
38-
logger: new Logger("runs-replication-shutdown-handover-a", "debug"),
39+
logger: new Logger("runs-replication-shutdown-handover-a", "warn"),
3940
});
4041

4142
await runsReplicationServiceA.start();
@@ -55,7 +56,7 @@ describe("RunsReplicationService (part 2/2)", () => {
5556
leaderLockExtendIntervalMs: 1000,
5657
leaderLockAcquireAdditionalTimeMs: 10_000,
5758
ackIntervalSeconds: 5,
58-
logger: new Logger("runs-replication-shutdown-handover-b", "debug"),
59+
logger: new Logger("runs-replication-shutdown-handover-b", "warn"),
5960
});
6061

6162
// Now we need to initiate starting the second service, and after 6 seconds, we need to shutdown the first service
@@ -147,6 +148,7 @@ describe("RunsReplicationService (part 2/2)", () => {
147148
const clickhouse = new ClickHouse({
148149
url: clickhouseContainer.getConnectionUrl(),
149150
name: "runs-replication-stress-bulk-insert",
151+
logLevel: "warn",
150152
});
151153

152154
const runsReplicationService = new RunsReplicationService({
@@ -162,7 +164,7 @@ describe("RunsReplicationService (part 2/2)", () => {
162164
leaderLockTimeoutMs: 5000,
163165
leaderLockExtendIntervalMs: 1000,
164166
ackIntervalSeconds: 5,
165-
logger: new Logger("runs-replication-stress-bulk-insert", "info"),
167+
logLevel: "warn",
166168
});
167169

168170
await runsReplicationService.start();
@@ -261,6 +263,7 @@ describe("RunsReplicationService (part 2/2)", () => {
261263
const clickhouse = new ClickHouse({
262264
url: clickhouseContainer.getConnectionUrl(),
263265
name: "runs-replication-stress-bulk-insert",
266+
logLevel: "warn",
264267
});
265268

266269
const runsReplicationService = new RunsReplicationService({
@@ -276,7 +279,7 @@ describe("RunsReplicationService (part 2/2)", () => {
276279
leaderLockTimeoutMs: 5000,
277280
leaderLockExtendIntervalMs: 1000,
278281
ackIntervalSeconds: 5,
279-
logger: new Logger("runs-replication-stress-bulk-insert", "info"),
282+
logLevel: "warn",
280283
});
281284

282285
await runsReplicationService.start();
@@ -381,6 +384,7 @@ describe("RunsReplicationService (part 2/2)", () => {
381384
const clickhouse = new ClickHouse({
382385
url: clickhouseContainer.getConnectionUrl(),
383386
name: "runs-replication-multi-event-tx",
387+
logLevel: "warn",
384388
});
385389

386390
const runsReplicationService = new RunsReplicationService({
@@ -396,6 +400,7 @@ describe("RunsReplicationService (part 2/2)", () => {
396400
leaderLockTimeoutMs: 5000,
397401
leaderLockExtendIntervalMs: 1000,
398402
ackIntervalSeconds: 5,
403+
logLevel: "warn",
399404
});
400405

401406
await runsReplicationService.start();
@@ -513,6 +518,7 @@ describe("RunsReplicationService (part 2/2)", () => {
513518
const clickhouse = new ClickHouse({
514519
url: clickhouseContainer.getConnectionUrl(),
515520
name: "runs-replication-long-tx",
521+
logLevel: "warn",
516522
});
517523

518524
const runsReplicationService = new RunsReplicationService({
@@ -528,7 +534,7 @@ describe("RunsReplicationService (part 2/2)", () => {
528534
leaderLockTimeoutMs: 5000,
529535
leaderLockExtendIntervalMs: 1000,
530536
ackIntervalSeconds: 5,
531-
logger: new Logger("runs-replication-long-tx", "info"),
537+
logLevel: "warn",
532538
});
533539

534540
await runsReplicationService.start();
@@ -619,6 +625,7 @@ describe("RunsReplicationService (part 2/2)", () => {
619625
const clickhouse = new ClickHouse({
620626
url: clickhouseContainer.getConnectionUrl(),
621627
name: "runs-replication-stress-bulk-insert",
628+
logLevel: "warn",
622629
});
623630

624631
const runsReplicationService = new RunsReplicationService({
@@ -634,7 +641,7 @@ describe("RunsReplicationService (part 2/2)", () => {
634641
leaderLockTimeoutMs: 5000,
635642
leaderLockExtendIntervalMs: 1000,
636643
ackIntervalSeconds: 5,
637-
logger: new Logger("runs-replication-stress-bulk-insert", "info"),
644+
logLevel: "warn",
638645
});
639646

640647
await runsReplicationService.start();
@@ -787,6 +794,7 @@ describe("RunsReplicationService (part 2/2)", () => {
787794
const clickhouse = new ClickHouse({
788795
url: clickhouseContainer.getConnectionUrl(),
789796
name: "runs-replication-merge-batch",
797+
logLevel: "warn",
790798
});
791799

792800
const runsReplicationService = new RunsReplicationService({
@@ -802,7 +810,7 @@ describe("RunsReplicationService (part 2/2)", () => {
802810
leaderLockTimeoutMs: 5000,
803811
leaderLockExtendIntervalMs: 1000,
804812
ackIntervalSeconds: 5,
805-
logger: new Logger("runs-replication-merge-batch", "info"),
813+
logLevel: "warn",
806814
});
807815

808816
// Listen to batchFlushed events to verify merging
@@ -911,6 +919,7 @@ describe("RunsReplicationService (part 2/2)", () => {
911919
const clickhouse = new ClickHouse({
912920
url: clickhouseContainer.getConnectionUrl(),
913921
name: "runs-replication-sorting",
922+
logLevel: "warn",
914923
});
915924

916925
const runsReplicationService = new RunsReplicationService({
@@ -926,7 +935,7 @@ describe("RunsReplicationService (part 2/2)", () => {
926935
leaderLockTimeoutMs: 5000,
927936
leaderLockExtendIntervalMs: 1000,
928937
ackIntervalSeconds: 5,
929-
logger: new Logger("runs-replication-sorting", "info"),
938+
logLevel: "warn",
930939
});
931940

932941
// Listen to batchFlushed events to verify sorting

0 commit comments

Comments
 (0)