Skip to content

Commit

Permalink
Patch up a couple sqlite tests (bluesky-social#1355)
Browse files Browse the repository at this point in the history
patch up a couple sqlite tests
  • Loading branch information
dholms authored and mloar committed Sep 25, 2023
1 parent e9ea3d2 commit 04768f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/pds/src/sequencer/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const sequenceEvt = async (dbTxn: Database, evt: RepoSeqInsert) => {
.set({ seq: res.id })
.where('id', '=', res.id)
.execute()
await dbTxn.notify('outgoing_repo_seq')
}
}

Expand Down
1 change: 1 addition & 0 deletions packages/pds/src/sequencer/sequencer-leader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export class SequencerLeader {
}

async isCaughtUp(): Promise<boolean> {
if (this.db.dialect === 'sqlite') return true
const unsequenced = await this.getUnsequenced()
return unsequenced.length === 0
}
Expand Down
4 changes: 4 additions & 0 deletions packages/pds/tests/algos/whats-hot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ describe('algo whats-hot', () => {
})

it('returns well liked posts', async () => {
if (server.ctx.db.dialect === 'sqlite') return

const img = await sc.uploadFile(
alice,
'tests/image/fixtures/key-landscape-small.jpg',
Expand Down Expand Up @@ -101,6 +103,8 @@ describe('algo whats-hot', () => {
})

it('paginates', async () => {
if (server.ctx.db.dialect === 'sqlite') return

const res = await agent.api.app.bsky.feed.getFeed(
{ feed: feedUri },
{ headers: sc.getHeaders(alice) },
Expand Down
2 changes: 1 addition & 1 deletion packages/pds/tests/sequencer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('sequencer', () => {

const caughtUp = (outbox: Outbox): (() => Promise<boolean>) => {
return async () => {
const leaderCaughtUp = await server.ctx.sequencerLeader.isCaughtUp()
const leaderCaughtUp = await server.ctx.sequencerLeader?.isCaughtUp()
if (!leaderCaughtUp) return false
const lastEvt = await outbox.sequencer.curr()
if (!lastEvt) return true
Expand Down

0 comments on commit 04768f7

Please sign in to comment.