Skip to content

Commit b3e1091

Browse files
test: allow eventual consistency in tests (#1128)
* test: allow eventual consistency in tests * test: add retries to 40 bytes payload feed test * build: update dependencies * test: update test coverage * test: update test coverage * test: update test coverage * build: bump dependency to fix test issue * test: update test coverage --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 67333fb commit b3e1091

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
},
6363
"dependencies": {
6464
"axios": "^0.30.0",
65-
"cafe-utility": "^32.2.0",
65+
"cafe-utility": "^33.3.3",
6666
"debug": "^4.4.1",
6767
"isomorphic-ws": "^4.0.1",
6868
"semver": "^7.3.5",

test/integration/feed.ux.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ test('Feed read/write 40 bytes payload', async () => {
5454
waitMillis: Dates.seconds(1),
5555
})
5656

57-
const latestReadResult = await writer.downloadPayload()
57+
const latestReadResult = await System.withRetries(
58+
async () => writer.downloadPayload(),
59+
10,
60+
Dates.seconds(1),
61+
Dates.seconds(2),
62+
)
5863
expect(latestReadResult.payload.toUtf8()).toBe('This string is exactly 40 bytes in utf-8')
5964
})
6065

test/integration/manifest.spec.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Dates, System } from 'cafe-utility'
12
import { MantarayNode, NULL_ADDRESS, PrivateKey, Topic } from '../../src'
23
import { arbitraryPrivateKey, arbitraryReference, batch, makeBee } from '../utils'
34

@@ -93,7 +94,12 @@ test('Manifest feed resolver', async () => {
9394
'swarm-feed-type': 'Sequence',
9495
})
9596

96-
const feedUpdate = (await node.resolveFeed(bee)).getOrThrow()
97+
const feedUpdate = await System.withRetries(
98+
async () => (await node.resolveFeed(bee)).getOrThrow(),
99+
10,
100+
Dates.seconds(1),
101+
Dates.seconds(2),
102+
)
97103
const resolved = MantarayNode.unmarshalFromData(feedUpdate.payload.toUint8Array(), NULL_ADDRESS)
98104
await resolved.loadRecursively(bee)
99105

0 commit comments

Comments
 (0)