Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ Changes before Tatum release are not documented in this file.
#### Fixed

- Fix operator flag voting behavior when using custom gas estimation (https://github.com/streamr-dev/network/pull/2784)
- Fix a bug causing the inspection process to freeze (https://github.com/streamr-dev/network/pull/2893)

#### Security

Expand Down
1 change: 1 addition & 0 deletions packages/node/src/plugins/operator/inspectOverTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ class InspectionOverTimeTask {

destroy(): void {
this.abortController.abort()
this.doneGate.open()
}

private async run(): Promise<void> {
Expand Down
33 changes: 33 additions & 0 deletions packages/node/test/unit/plugins/operator/inspectOverTime.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { randomDhtAddress } from '@streamr/dht'
import { randomEthereumAddress } from '@streamr/test-utils'
import { StreamPartIDUtils } from '@streamr/utils'
import { inspectOverTime } from '../../../../src/plugins/operator/inspectOverTime'

describe('inspectOverTime', () => {

it('getRedundancyFactor() rejects (NET-1377)', async () => {
const task = inspectOverTime({
target: {
sponsorshipAddress: randomEthereumAddress(),
operatorAddress: randomEthereumAddress(),
streamPart: StreamPartIDUtils.parse('stream#0')
},
streamrClient: undefined as any,
createOperatorFleetState: () => ({
getNodeIds: () => [randomDhtAddress()],
start: async () => {},
waitUntilReady: () => Promise.resolve(),
destroy: async () => {}
} as any),
getRedundancyFactor: () => Promise.reject(new Error('mock-error')),
delayBeforeFirstInspectionInMs: 0,
heartbeatTimeoutInMs: 0,
inspectionIntervalInMs: 1000,
maxInspectionCount: 1,
waitUntilPassOrDone: true,
abortSignal: new AbortController().signal,
traceId: ''
})
await expect(task()).resolves.toEqual([])
})
})
Loading