Skip to content

Commit 1a0067b

Browse files
fix pds tests flakiness
1 parent 933b6ba commit 1a0067b

13 files changed

+38
-17
lines changed

.changeset/lemon-adults-sparkle.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@atproto/ozone": patch
3+
---
4+
5+
Fix typo in recordsStats's $type property

.changeset/tall-kings-poke.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@atproto/pds": patch
3+
---
4+
5+
Fix flaky tests

packages/ozone/src/mod-service/views.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ export class ModerationViews {
628628

629629
recordsStats: {
630630
// Explicitly typing to allow for easy manipulation (e.g. to strip from tests snapshots)
631-
$type: 'tools.ozone.moderation.defs#recordStats',
631+
$type: 'tools.ozone.moderation.defs#recordsStats',
632632

633633
// account_record_events_stats
634634
totalReports: status.totalReports ?? undefined,

packages/ozone/tests/__snapshots__/get-record.test.ts.snap

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Object {
4141
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
4242
"lastReviewedBy": "user(1)",
4343
"recordsStats": Object {
44-
"$type": "tools.ozone.moderation.defs#recordStats",
44+
"$type": "tools.ozone.moderation.defs#recordsStats",
4545
"appealedCount": 0,
4646
"escalatedCount": 0,
4747
"pendingCount": 0,
@@ -161,7 +161,7 @@ Object {
161161
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
162162
"lastReviewedBy": "user(1)",
163163
"recordsStats": Object {
164-
"$type": "tools.ozone.moderation.defs#recordStats",
164+
"$type": "tools.ozone.moderation.defs#recordsStats",
165165
"appealedCount": 0,
166166
"escalatedCount": 0,
167167
"pendingCount": 0,

packages/ozone/tests/__snapshots__/get-records.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Object {
4444
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
4545
"lastReviewedBy": "user(1)",
4646
"recordsStats": Object {
47-
"$type": "tools.ozone.moderation.defs#recordStats",
47+
"$type": "tools.ozone.moderation.defs#recordsStats",
4848
"appealedCount": 0,
4949
"escalatedCount": 0,
5050
"pendingCount": 0,

packages/ozone/tests/__snapshots__/get-repo.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Object {
4040
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
4141
"lastReviewedBy": "user(1)",
4242
"recordsStats": Object {
43-
"$type": "tools.ozone.moderation.defs#recordStats",
43+
"$type": "tools.ozone.moderation.defs#recordsStats",
4444
},
4545
"reviewState": "tools.ozone.moderation.defs#reviewClosed",
4646
"subject": Object {

packages/ozone/tests/__snapshots__/get-repos.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Object {
4343
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
4444
"lastReviewedBy": "user(1)",
4545
"recordsStats": Object {
46-
"$type": "tools.ozone.moderation.defs#recordStats",
46+
"$type": "tools.ozone.moderation.defs#recordsStats",
4747
},
4848
"reviewState": "tools.ozone.moderation.defs#reviewClosed",
4949
"subject": Object {

packages/ozone/tests/__snapshots__/moderation-events.test.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Object {
3636
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
3737
"lastReviewedBy": "user(1)",
3838
"recordsStats": Object {
39-
"$type": "tools.ozone.moderation.defs#recordStats",
39+
"$type": "tools.ozone.moderation.defs#recordsStats",
4040
"appealedCount": 0,
4141
"escalatedCount": 0,
4242
"pendingCount": 2,

packages/ozone/tests/__snapshots__/moderation-statuses.test.ts.snap

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Array [
1919
"id": 7,
2020
"lastReportedAt": "1970-01-01T00:00:00.000Z",
2121
"recordsStats": Object {
22-
"$type": "tools.ozone.moderation.defs#recordStats",
22+
"$type": "tools.ozone.moderation.defs#recordsStats",
2323
"appealedCount": 0,
2424
"escalatedCount": 0,
2525
"pendingCount": 1,
@@ -62,7 +62,7 @@ Array [
6262
"id": 5,
6363
"lastReportedAt": "1970-01-01T00:00:00.000Z",
6464
"recordsStats": Object {
65-
"$type": "tools.ozone.moderation.defs#recordStats",
65+
"$type": "tools.ozone.moderation.defs#recordsStats",
6666
"appealedCount": 0,
6767
"escalatedCount": 0,
6868
"pendingCount": 1,
@@ -109,7 +109,7 @@ Array [
109109
"id": 7,
110110
"lastReportedAt": "1970-01-01T00:00:00.000Z",
111111
"recordsStats": Object {
112-
"$type": "tools.ozone.moderation.defs#recordStats",
112+
"$type": "tools.ozone.moderation.defs#recordsStats",
113113
"appealedCount": 0,
114114
"escalatedCount": 0,
115115
"pendingCount": 1,
@@ -152,7 +152,7 @@ Array [
152152
"id": 5,
153153
"lastReportedAt": "1970-01-01T00:00:00.000Z",
154154
"recordsStats": Object {
155-
"$type": "tools.ozone.moderation.defs#recordStats",
155+
"$type": "tools.ozone.moderation.defs#recordsStats",
156156
"appealedCount": 0,
157157
"escalatedCount": 0,
158158
"pendingCount": 1,
@@ -194,7 +194,7 @@ Array [
194194
"id": 3,
195195
"lastReportedAt": "1970-01-01T00:00:00.000Z",
196196
"recordsStats": Object {
197-
"$type": "tools.ozone.moderation.defs#recordStats",
197+
"$type": "tools.ozone.moderation.defs#recordsStats",
198198
"appealedCount": 0,
199199
"escalatedCount": 0,
200200
"pendingCount": 1,
@@ -236,7 +236,7 @@ Array [
236236
"id": 1,
237237
"lastReportedAt": "1970-01-01T00:00:00.000Z",
238238
"recordsStats": Object {
239-
"$type": "tools.ozone.moderation.defs#recordStats",
239+
"$type": "tools.ozone.moderation.defs#recordsStats",
240240
"appealedCount": 0,
241241
"escalatedCount": 0,
242242
"pendingCount": 1,

packages/pds/tests/__snapshots__/takedown-appeal.test.ts.snap

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ exports[`appeal account takedown actor takedown allows appeal request. 1`] = `
44
Object {
55
"accountStats": Object {
66
"$type": "tools.ozone.moderation.defs#accountStats",
7+
"appealCount": 0,
8+
"escalateCount": 0,
9+
"reportCount": 0,
10+
"suspendCount": 0,
11+
"takedownCount": 1,
712
},
813
"appealed": true,
914
"createdAt": "1970-01-01T00:00:00.000Z",
@@ -17,7 +22,7 @@ Object {
1722
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
1823
"lastReviewedBy": "user(0)",
1924
"recordsStats": Object {
20-
"$type": "tools.ozone.moderation.defs#recordStats",
25+
"$type": "tools.ozone.moderation.defs#recordsStats",
2126
},
2227
"reviewState": "tools.ozone.moderation.defs#reviewEscalated",
2328
"subject": Object {

packages/pds/tests/proxied/__snapshots__/admin.test.ts.snap

+3-3
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Object {
160160
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
161161
"lastReviewedBy": "user(1)",
162162
"recordsStats": Object {
163-
"$type": "tools.ozone.moderation.defs#recordStats",
163+
"$type": "tools.ozone.moderation.defs#recordsStats",
164164
"appealedCount": 0,
165165
"escalatedCount": 0,
166166
"pendingCount": 0,
@@ -276,7 +276,7 @@ Object {
276276
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
277277
"lastReviewedBy": "user(1)",
278278
"recordsStats": Object {
279-
"$type": "tools.ozone.moderation.defs#recordStats",
279+
"$type": "tools.ozone.moderation.defs#recordsStats",
280280
"appealedCount": 0,
281281
"escalatedCount": 0,
282282
"pendingCount": 0,
@@ -357,7 +357,7 @@ Object {
357357
"lastReviewedAt": "1970-01-01T00:00:00.000Z",
358358
"lastReviewedBy": "user(1)",
359359
"recordsStats": Object {
360-
"$type": "tools.ozone.moderation.defs#recordStats",
360+
"$type": "tools.ozone.moderation.defs#recordsStats",
361361
"appealedCount": 0,
362362
"escalatedCount": 0,
363363
"pendingCount": 0,

packages/pds/tests/sequencer.test.ts

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ describe('sequencer', () => {
3737
totalEvts = 14
3838
})
3939

40+
beforeEach(async () => {
41+
await network.processAll()
42+
})
43+
4044
afterAll(async () => {
4145
await network.close()
4246
})

packages/pds/tests/takedown-appeal.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ describe('appeal account takedown', () => {
6161
},
6262
)
6363

64+
await network.processAll()
65+
6466
// Verify user can not get session token without setting the optional param
6567
await expect(
6668
agent.com.atproto.server.createSession({

0 commit comments

Comments
 (0)