From 6787614f3957268e9210f44230d3b1eff374c879 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 10:02:19 +0200 Subject: [PATCH 01/22] build: increase number of providers from 12 to 24 --- tests/docker/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/docker-compose.yml b/tests/docker/docker-compose.yml index 5c945eae3..74541bae9 100644 --- a/tests/docker/docker-compose.yml +++ b/tests/docker/docker-compose.yml @@ -7,7 +7,7 @@ services: image: provider:latest restart: always deploy: - replicas: 6 + replicas: 12 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ @@ -30,7 +30,7 @@ services: image: provider:latest restart: always deploy: - replicas: 6 + replicas: 12 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ From f62a9f2735f9cb41f090be1e872cbee4e706d961 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 10:42:53 +0200 Subject: [PATCH 02/22] fix(jobs): fixed the issue with agreements getting terminated before job work is executed --- src/experimental/job/job.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/experimental/job/job.ts b/src/experimental/job/job.ts index 395705e24..f59247adb 100644 --- a/src/experimental/job/job.ts +++ b/src/experimental/job/job.ts @@ -145,7 +145,8 @@ export class Job { } signal.addEventListener("abort", () => this.events.emit("canceled"), { once: true }); - return workOnGolem(exeUnit); + // Wait for the results to come back before going to finally and terminating the rental while the work is executed + return await workOnGolem(exeUnit); } finally { await rental.stopAndFinalize(); } From 8e60711a8cf999cb42436f2de4f9d525b67a61f9 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 11:14:22 +0200 Subject: [PATCH 03/22] Revert "build: increase number of providers from 12 to 24" This reverts commit 6787614f3957268e9210f44230d3b1eff374c879. --- tests/docker/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/docker-compose.yml b/tests/docker/docker-compose.yml index 74541bae9..5c945eae3 100644 --- a/tests/docker/docker-compose.yml +++ b/tests/docker/docker-compose.yml @@ -7,7 +7,7 @@ services: image: provider:latest restart: always deploy: - replicas: 12 + replicas: 6 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ @@ -30,7 +30,7 @@ services: image: provider:latest restart: always deploy: - replicas: 12 + replicas: 6 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ From 8c80df729107ac52ed6b3a95f7490b77c360cbf1 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 11:37:23 +0200 Subject: [PATCH 04/22] refactor: added few more result lines to web example cypress test --- examples/web/hello.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/web/hello.html b/examples/web/hello.html index 0e022139d..9b3af5e5b 100644 --- a/examples/web/hello.html +++ b/examples/web/hello.html @@ -115,11 +115,13 @@

Results

await glm.connect(); appendResults("Request for renting a provider machine"); const rental = await glm.oneOf({ order }); + appendResults("Rented resources from", rental.agreement.provider.name); await rental .getExeUnit() .then(async (exe) => appendResults("Reply: " + (await exe.run(`echo 'Hello Golem! 👋 from ${exe.provider.name}!'`)).stdout), ); + appendResults("Finished all work with the resources"); await rental.stopAndFinalize(); appendResults("Finalized renting process"); } catch (err) { From 756323b6aa52a57ffeba4b2a93324301bbd9c36e Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 11:38:04 +0200 Subject: [PATCH 05/22] Revert "Revert "build: increase number of providers from 12 to 24"" This reverts commit 8e60711a8cf999cb42436f2de4f9d525b67a61f9. --- tests/docker/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/docker/docker-compose.yml b/tests/docker/docker-compose.yml index 5c945eae3..74541bae9 100644 --- a/tests/docker/docker-compose.yml +++ b/tests/docker/docker-compose.yml @@ -7,7 +7,7 @@ services: image: provider:latest restart: always deploy: - replicas: 6 + replicas: 12 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ @@ -30,7 +30,7 @@ services: image: provider:latest restart: always deploy: - replicas: 6 + replicas: 12 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ From 28fadc2fb2e060df3f31104a1457ce12a161986b Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 12:09:06 +0200 Subject: [PATCH 06/22] refactor(golem-network): pass GN logger to the underlying storage provider --- src/golem-network/golem-network.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/golem-network/golem-network.ts b/src/golem-network/golem-network.ts index 1e40d30f8..6c00f5908 100644 --- a/src/golem-network/golem-network.ts +++ b/src/golem-network/golem-network.ts @@ -646,10 +646,12 @@ export class GolemNetwork { if (typeof this.options.dataTransferProtocol === "string") { switch (this.options.dataTransferProtocol) { case "ws": - return new WebSocketBrowserStorageProvider(this.yagna, {}); + return new WebSocketBrowserStorageProvider(this.yagna, { + logger: this.logger, + }); case "gftp": default: - return new GftpStorageProvider(); + return new GftpStorageProvider(this.logger); } } else if (this.options.dataTransferProtocol !== undefined) { return this.options.dataTransferProtocol; From e2ab7e997443a80c4680738e5018d35612f5172c Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 12:11:57 +0200 Subject: [PATCH 07/22] refactor(examples): switch all examples log level to debug --- examples/core-api/manual-pools.ts | 2 +- examples/core-api/override-module.ts | 2 +- examples/core-api/step-by-step.ts | 2 +- examples/docs-examples/quickstarts/quickstart/requestor.mjs | 2 +- examples/experimental/deployment/new-api.ts | 2 +- examples/rental-model/advanced/local-image/serveLocalGvmi.ts | 2 +- examples/rental-model/advanced/payment-filters.ts | 2 +- examples/rental-model/advanced/proposal-filter.ts | 2 +- examples/rental-model/advanced/proposal-predefined-filter.ts | 2 +- examples/rental-model/advanced/proposal-selector.ts | 2 +- examples/rental-model/advanced/reuse-allocation.ts | 2 +- examples/rental-model/basic/events.ts | 2 +- examples/rental-model/basic/many-of.ts | 2 +- examples/rental-model/basic/one-of.ts | 2 +- examples/rental-model/basic/run-and-stream.ts | 2 +- examples/rental-model/basic/transfer.ts | 2 +- examples/rental-model/basic/vpn.ts | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/core-api/manual-pools.ts b/examples/core-api/manual-pools.ts index 6e0d2e11a..e0c4a9472 100644 --- a/examples/core-api/manual-pools.ts +++ b/examples/core-api/manual-pools.ts @@ -26,7 +26,7 @@ const demandOptions = { (async () => { const logger = pinoPrettyLogger({ - level: "info", + level: "debug", }); const glm = new GolemNetwork({ diff --git a/examples/core-api/override-module.ts b/examples/core-api/override-module.ts index f71ffd5d4..da155d420 100644 --- a/examples/core-api/override-module.ts +++ b/examples/core-api/override-module.ts @@ -43,7 +43,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), // here's where we provide our own implementation override: { diff --git a/examples/core-api/step-by-step.ts b/examples/core-api/step-by-step.ts index 5ec4e30a9..c63d11cf0 100644 --- a/examples/core-api/step-by-step.ts +++ b/examples/core-api/step-by-step.ts @@ -17,7 +17,7 @@ import { filter, map, switchMap, take } from "rxjs"; (async () => { const logger = pinoPrettyLogger({ - level: "info", + level: "debug", }); const glm = new GolemNetwork({ diff --git a/examples/docs-examples/quickstarts/quickstart/requestor.mjs b/examples/docs-examples/quickstarts/quickstart/requestor.mjs index f1ffeca85..9b1b9cbcf 100644 --- a/examples/docs-examples/quickstarts/quickstart/requestor.mjs +++ b/examples/docs-examples/quickstarts/quickstart/requestor.mjs @@ -23,7 +23,7 @@ const order = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), api: { key: "try_golem" }, }); diff --git a/examples/experimental/deployment/new-api.ts b/examples/experimental/deployment/new-api.ts index 607e049bd..bdac115ca 100644 --- a/examples/experimental/deployment/new-api.ts +++ b/examples/experimental/deployment/new-api.ts @@ -5,7 +5,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; async function main() { const golem = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/advanced/local-image/serveLocalGvmi.ts b/examples/rental-model/advanced/local-image/serveLocalGvmi.ts index 3c4503539..5b58909f1 100644 --- a/examples/rental-model/advanced/local-image/serveLocalGvmi.ts +++ b/examples/rental-model/advanced/local-image/serveLocalGvmi.ts @@ -10,7 +10,7 @@ const getImagePath = (path: string) => new URL(path, import.meta.url).toString() (async () => { const logger = pinoPrettyLogger({ - level: "info", + level: "debug", }); const glm = new GolemNetwork({ diff --git a/examples/rental-model/advanced/payment-filters.ts b/examples/rental-model/advanced/payment-filters.ts index ff1b28092..19f7f75af 100644 --- a/examples/rental-model/advanced/payment-filters.ts +++ b/examples/rental-model/advanced/payment-filters.ts @@ -55,7 +55,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/advanced/proposal-filter.ts b/examples/rental-model/advanced/proposal-filter.ts index a9599ed59..cca13143e 100644 --- a/examples/rental-model/advanced/proposal-filter.ts +++ b/examples/rental-model/advanced/proposal-filter.ts @@ -29,7 +29,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/advanced/proposal-predefined-filter.ts b/examples/rental-model/advanced/proposal-predefined-filter.ts index cee05be92..8fc8f2ea8 100644 --- a/examples/rental-model/advanced/proposal-predefined-filter.ts +++ b/examples/rental-model/advanced/proposal-predefined-filter.ts @@ -27,7 +27,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/advanced/proposal-selector.ts b/examples/rental-model/advanced/proposal-selector.ts index fa818cebb..3dc6437ac 100644 --- a/examples/rental-model/advanced/proposal-selector.ts +++ b/examples/rental-model/advanced/proposal-selector.ts @@ -35,7 +35,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/advanced/reuse-allocation.ts b/examples/rental-model/advanced/reuse-allocation.ts index e2b212b18..63d0580d2 100644 --- a/examples/rental-model/advanced/reuse-allocation.ts +++ b/examples/rental-model/advanced/reuse-allocation.ts @@ -16,7 +16,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/basic/events.ts b/examples/rental-model/basic/events.ts index 9c6462d35..c6c9260af 100644 --- a/examples/rental-model/basic/events.ts +++ b/examples/rental-model/basic/events.ts @@ -7,7 +7,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), payment: { driver: "erc20", diff --git a/examples/rental-model/basic/many-of.ts b/examples/rental-model/basic/many-of.ts index 7f381eb33..6f3b1c0e5 100644 --- a/examples/rental-model/basic/many-of.ts +++ b/examples/rental-model/basic/many-of.ts @@ -23,7 +23,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/basic/one-of.ts b/examples/rental-model/basic/one-of.ts index 214145c3b..8b1e06482 100644 --- a/examples/rental-model/basic/one-of.ts +++ b/examples/rental-model/basic/one-of.ts @@ -19,7 +19,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/basic/run-and-stream.ts b/examples/rental-model/basic/run-and-stream.ts index a573c9643..4906b826b 100644 --- a/examples/rental-model/basic/run-and-stream.ts +++ b/examples/rental-model/basic/run-and-stream.ts @@ -24,7 +24,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/basic/transfer.ts b/examples/rental-model/basic/transfer.ts index 4874c4f0a..52238aa25 100644 --- a/examples/rental-model/basic/transfer.ts +++ b/examples/rental-model/basic/transfer.ts @@ -20,7 +20,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); diff --git a/examples/rental-model/basic/vpn.ts b/examples/rental-model/basic/vpn.ts index c93351d10..ef36ca5ca 100644 --- a/examples/rental-model/basic/vpn.ts +++ b/examples/rental-model/basic/vpn.ts @@ -4,7 +4,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "info", + level: "debug", }), }); From a02eee7845dcd0db0df53deebfcc5c0636d21715 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 12:14:56 +0200 Subject: [PATCH 08/22] refactor(market): provide more debug logs related to getting draft proposals from pool --- src/market/market.module.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/market/market.module.ts b/src/market/market.module.ts index 87eed3708..0596d4b25 100644 --- a/src/market/market.module.ts +++ b/src/market/market.module.ts @@ -530,13 +530,20 @@ export class MarketModuleImpl implements MarketModule { agreementOptions?: AgreementOptions, signalOrTimeout?: number | AbortSignal, ): Promise { - this.logger.info("Trying to sign an agreement ..."); + this.logger.info("Trying to sign an agreement..."); const signal = createAbortSignalFromTimeout(signalOrTimeout); const getProposal = async () => { try { signal.throwIfAborted(); + this.logger.debug("Acquiring proposal from draft proposal pool", { + draftPoolCounters: { + total: draftProposalPool.count(), + available: draftProposalPool.availableCount(), + }, + }); const proposal = await draftProposalPool.acquire(signal); + this.logger.debug("Acquired proposal from the pool", { proposal }); if (signal.aborted) { await draftProposalPool.release(proposal); signal.throwIfAborted(); From fb34ca7298332e4941ee8fa7767bf01c2f8cb900 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 12:45:19 +0200 Subject: [PATCH 09/22] build: fixup for the change above --- package-lock.json | 8 ++++---- package.json | 2 +- src/market/market.module.test.ts | 22 ++++++++++------------ 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f27ca743..db0279125 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,6 @@ "examples/" ], "dependencies": { - "@rollup/rollup-win32-x64-msvc": "^4", "async-lock": "^1.4.1", "async-retry": "^1.3.3", "axios": "^1.6.7", @@ -34,7 +33,7 @@ "devDependencies": { "@commitlint/cli": "^19.0.3", "@commitlint/config-conventional": "^19.0.3", - "@johanblumenberg/ts-mockito": "^1.0.41", + "@johanblumenberg/ts-mockito": "^1.0.43", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", @@ -2341,9 +2340,10 @@ } }, "node_modules/@johanblumenberg/ts-mockito": { - "version": "1.0.41", + "version": "1.0.43", + "resolved": "https://registry.npmjs.org/@johanblumenberg/ts-mockito/-/ts-mockito-1.0.43.tgz", + "integrity": "sha512-7C1JMJzYPLmW4/nFZHTQTog/wRnB45UUU3hEur1p7HJDlpQpybQWAbE8yA+mBk+95mOEfuIVNcebSAB/KGrE0w==", "dev": true, - "license": "MIT", "dependencies": { "lodash": "^4.17.20" } diff --git a/package.json b/package.json index ec712d9e5..5298950b3 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "devDependencies": { "@commitlint/cli": "^19.0.3", "@commitlint/config-conventional": "^19.0.3", - "@johanblumenberg/ts-mockito": "^1.0.41", + "@johanblumenberg/ts-mockito": "^1.0.43", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-commonjs": "^25.0.7", "@rollup/plugin-json": "^6.1.0", diff --git a/src/market/market.module.test.ts b/src/market/market.module.test.ts index 35cb21bc2..6c506dc81 100644 --- a/src/market/market.module.test.ts +++ b/src/market/market.module.test.ts @@ -1,4 +1,4 @@ -import { _, imock, instance, mock, reset, spy, verify, when } from "@johanblumenberg/ts-mockito"; +import { _, imock, instance, mock, MockPropertyPolicy, reset, spy, verify, when } from "@johanblumenberg/ts-mockito"; import { Logger, YagnaApi } from "../shared/utils"; import { MarketModuleImpl } from "./market.module"; import { Demand, DemandSpecification } from "./demand"; @@ -439,9 +439,11 @@ describe("Market module", () => { const badProposal0 = {} as OfferProposal; const badProposal1 = {} as OfferProposal; const goodProposal = {} as OfferProposal; - const mockPool = mock(DraftOfferProposalPool); - when(mockPool.acquire(_)).thenResolve(badProposal0).thenResolve(badProposal1).thenResolve(goodProposal); + + const mockPool = mock(DraftOfferProposalPool, MockPropertyPolicy.StubAsProperty); when(mockPool.remove(_)).thenResolve(); + when(mockPool.acquire(_)).thenResolve(badProposal0).thenResolve(badProposal1).thenResolve(goodProposal); + const goodAgreement = {} as Agreement; const marketSpy = spy(marketModule); when(marketSpy.proposeAgreement(goodProposal, _)).thenResolve(goodAgreement); @@ -499,15 +501,11 @@ describe("Market module", () => { ); }); it("respects the timeout on draft proposal pool acquire and forwards the error", async () => { - const mockAcquire: DraftOfferProposalPool["acquire"] = jest - .fn() - .mockImplementation( - () => new Promise((_, reject) => setTimeout(() => reject(new Error("Failed to acquire")), 10)), - ); - const mockPool = { - acquire: mockAcquire, - } as DraftOfferProposalPool; - expect(marketModule.signAgreementFromPool(mockPool)).rejects.toThrow("Failed to acquire"); + const mockPool = mock(DraftOfferProposalPool); + when(mockPool.acquire(_)).thenCall( + () => new Promise((_, reject) => setTimeout(() => reject(new Error("Failed to acquire")), 10)), + ); + expect(marketModule.signAgreementFromPool(instance(mockPool))).rejects.toThrow("Failed to acquire"); }); }); From 66a0243412586829bb255c4b418882832bab1438 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 13:15:02 +0200 Subject: [PATCH 10/22] refactor: removed noisy log line --- src/market/market.module.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/market/market.module.ts b/src/market/market.module.ts index 0596d4b25..f169a4f57 100644 --- a/src/market/market.module.ts +++ b/src/market/market.module.ts @@ -610,7 +610,6 @@ export class MarketModuleImpl implements MarketModule { if (isCancelled) { return; } - this.logger.debug("Waiting for reduced proposals..."); try { await proposalsBatch.waitForProposals(); const proposals = await proposalsBatch.getProposals(); From 060912d37013b4b05ef3203dc7b37e79f3c49e43 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 14:00:27 +0200 Subject: [PATCH 11/22] build: adjusted GH action for debugging --- .github/actions/prepare-tests/action.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index 76d700a05..3d90b774e 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -59,3 +59,22 @@ runs: shell: bash run: | docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && ./node_modules/.bin/cypress install" + + - name: Run a preliminary scan of offers + shell: bash + run: | + docker exec -t docker-requestor-1 /bin/sh -c "npx @golem-sdk/cli market scan -k try_golem" + + - name: List down sessions seen on that requestor + shell: bash + run: | + docker exec docker-requestor-1 /bin/sh -c "npx @golem-sdk/cli market scan -k try_golem" + + - name: Sleep for a while to wait for further propagation + shell: bash + run: sleep 300 # 5 minutes + + - name: Run a secondary scan of offers + shell: bash + run: | + docker exec -t docker-requestor-1 /bin/sh -c "npx @golem-sdk/cli market scan -k try_golem" From 31fe22bff92ef34a513ccba204897a6060ade310 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 14:26:00 +0200 Subject: [PATCH 12/22] build: fixup of pipeline --- .github/actions/prepare-tests/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index 3d90b774e..d393f99f9 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -63,12 +63,12 @@ runs: - name: Run a preliminary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx @golem-sdk/cli market scan -k try_golem" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem" - name: List down sessions seen on that requestor shell: bash run: | - docker exec docker-requestor-1 /bin/sh -c "npx @golem-sdk/cli market scan -k try_golem" + docker exec docker-requestor-1 /bin/sh -c "yagna net sessions" - name: Sleep for a while to wait for further propagation shell: bash @@ -77,4 +77,4 @@ runs: - name: Run a secondary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx @golem-sdk/cli market scan -k try_golem" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem" From b0a9e1272291ef739c8f1e1c713ee793e24fa2d2 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 14:28:27 +0200 Subject: [PATCH 13/22] build: do not show progress during SDK build for tests --- .github/actions/prepare-tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index d393f99f9..95e23fa3b 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -51,7 +51,7 @@ runs: shell: bash run: | echo "Going to build the SDK on the requestor" - docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i && npm run build" + docker exec -t docker-requestor-1 /bin/sh -c "cd /golem-js && npm i --no-progress && npm run build" echo "Successfully built the SDK on the requestor" - name: Install Cypress From 124d121c0548787d18f89ac08eedcb8b7acd7564 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 15:08:24 +0200 Subject: [PATCH 14/22] build: fix subnet in market scan done by the pipeline --- .github/actions/prepare-tests/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index 95e23fa3b..defd509a2 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -63,7 +63,7 @@ runs: - name: Run a preliminary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k $YAGNA_APPKEY --subnet-tag $SUBNET" - name: List down sessions seen on that requestor shell: bash @@ -77,4 +77,4 @@ runs: - name: Run a secondary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k $YAGNA_APPKEY --subnet-tag $SUBNET" From fa1f5e46a8038ce68d6710866a210081f52d10df Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 15:23:58 +0200 Subject: [PATCH 15/22] build: fix subnet in market scan done by the pipeline --- .github/actions/prepare-tests/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index defd509a2..f164edcc3 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -63,7 +63,7 @@ runs: - name: Run a preliminary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k $YAGNA_APPKEY --subnet-tag $SUBNET" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET" - name: List down sessions seen on that requestor shell: bash @@ -77,4 +77,4 @@ runs: - name: Run a secondary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k $YAGNA_APPKEY --subnet-tag $SUBNET" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET" From a8568bff8eaeeec6aa7a359e68014627a0c458b6 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Tue, 16 Jul 2024 15:59:44 +0200 Subject: [PATCH 16/22] build: use correct payment network when doing the market scan --- .github/actions/prepare-tests/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index f164edcc3..70ee0abc8 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -63,7 +63,7 @@ runs: - name: Run a preliminary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET --payment-network $PAYMENT_NETWORK" - name: List down sessions seen on that requestor shell: bash @@ -77,4 +77,4 @@ runs: - name: Run a secondary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET" + docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET --payment-network $PAYMENT_NETWORK" From 74590b593b365767644d10cf577c829f8fc84199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Krzysztof=20Rekucki?= Date: Wed, 17 Jul 2024 01:15:48 +0200 Subject: [PATCH 17/22] build: wait for 6 providers --- .github/actions/prepare-tests/action.yml | 6 +----- tests/docker/docker-compose.yml | 17 +++++++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index 70ee0abc8..daf122f65 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -63,17 +63,13 @@ runs: - name: Run a preliminary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npx --no-progress --yes @golem-sdk/cli market scan -k try_golem --subnet-tag $YAGNA_SUBNET --payment-network $PAYMENT_NETWORK" + docker exec -t docker-requestor-1 /bin/sh -c "npm install -g @prekucki/wait-for-n && wait-for-n --limit=6 --appkey=try_golem --subnet=$YAGNA_SUBNET" - name: List down sessions seen on that requestor shell: bash run: | docker exec docker-requestor-1 /bin/sh -c "yagna net sessions" - - name: Sleep for a while to wait for further propagation - shell: bash - run: sleep 300 # 5 minutes - - name: Run a secondary scan of offers shell: bash run: | diff --git a/tests/docker/docker-compose.yml b/tests/docker/docker-compose.yml index 74541bae9..a41a888d5 100644 --- a/tests/docker/docker-compose.yml +++ b/tests/docker/docker-compose.yml @@ -7,7 +7,7 @@ services: image: provider:latest restart: always deploy: - replicas: 12 + replicas: 6 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ @@ -20,9 +20,11 @@ services: retries: 1 start_period: 40s environment: - - YA_NET_BROADCAST_SIZE=30 + - YA_NET_BROADCAST_SIZE=10 - NODE_NAME=provider-1 - SUBNET=${YAGNA_SUBNET:-golemjstest} + - YA_NET_BIND_URL=udp://0.0.0.0:0 + - YA_NET_RELAY_HOST=63.34.24.27:7477 provider-2: build: context: . @@ -30,7 +32,7 @@ services: image: provider:latest restart: always deploy: - replicas: 12 + replicas: 6 volumes: - /etc/localtime:/etc/localtime:ro - /root/.local/share/yagna/ @@ -43,9 +45,11 @@ services: retries: 1 start_period: 40s environment: - - YA_NET_BROADCAST_SIZE=30 + - YA_NET_BROADCAST_SIZE=10 - NODE_NAME=provider-2 - SUBNET=${YAGNA_SUBNET:-golemjstest} + - YA_NET_BIND_URL=udp://0.0.0.0:0 + - YA_NET_RELAY_HOST=63.34.24.27:7477 requestor: build: context: . @@ -57,14 +61,15 @@ services: - /root/.local/share/yagna/ - ../../:/golem-js environment: - - YA_NET_BROADCAST_SIZE=30 + - YA_NET_BROADCAST_SIZE=10 - YAGNA_AUTOCONF_APPKEY=try_golem - YAGNA_API_URL=http://0.0.0.0:7465 - GSB_URL=tcp://0.0.0.0:7464 - YAGNA_SUBNET=${YAGNA_SUBNET:-golemjstest} - YAGNA_APPKEY=try_golem - PAYMENT_NETWORK=${PAYMENT_NETWORK} - + - YA_NET_BIND_URL=udp://0.0.0.0:0 + - YA_NET_RELAY_HOST=63.34.24.27:7477 healthcheck: test: ["CMD-SHELL", "curl -s -o /dev/null -w '%{http_code}' http://localhost:7465 | grep -q 401"] interval: 10s From fcc3b5fbe026e41fe6b716b196419299f659c3df Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 17 Jul 2024 10:07:07 +0200 Subject: [PATCH 18/22] build: set no-progress for installing @prekucki/wait-for-n --- .github/actions/prepare-tests/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/prepare-tests/action.yml b/.github/actions/prepare-tests/action.yml index daf122f65..22a38f172 100644 --- a/.github/actions/prepare-tests/action.yml +++ b/.github/actions/prepare-tests/action.yml @@ -63,7 +63,7 @@ runs: - name: Run a preliminary scan of offers shell: bash run: | - docker exec -t docker-requestor-1 /bin/sh -c "npm install -g @prekucki/wait-for-n && wait-for-n --limit=6 --appkey=try_golem --subnet=$YAGNA_SUBNET" + docker exec -t docker-requestor-1 /bin/sh -c "npm install --no-progress -g @prekucki/wait-for-n && wait-for-n --limit=6 --appkey=try_golem --subnet=$YAGNA_SUBNET" - name: List down sessions seen on that requestor shell: bash From 91aab75708fa09cd96237f31a8f7c3b6a88fbb02 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 17 Jul 2024 10:10:24 +0200 Subject: [PATCH 19/22] Revert "refactor(examples): switch all examples log level to debug" This reverts commit e2ab7e997443a80c4680738e5018d35612f5172c. --- examples/core-api/manual-pools.ts | 2 +- examples/core-api/override-module.ts | 2 +- examples/core-api/step-by-step.ts | 2 +- examples/docs-examples/quickstarts/quickstart/requestor.mjs | 2 +- examples/experimental/deployment/new-api.ts | 2 +- examples/rental-model/advanced/local-image/serveLocalGvmi.ts | 2 +- examples/rental-model/advanced/payment-filters.ts | 2 +- examples/rental-model/advanced/proposal-filter.ts | 2 +- examples/rental-model/advanced/proposal-predefined-filter.ts | 2 +- examples/rental-model/advanced/proposal-selector.ts | 2 +- examples/rental-model/advanced/reuse-allocation.ts | 2 +- examples/rental-model/basic/events.ts | 2 +- examples/rental-model/basic/many-of.ts | 2 +- examples/rental-model/basic/one-of.ts | 2 +- examples/rental-model/basic/run-and-stream.ts | 2 +- examples/rental-model/basic/transfer.ts | 2 +- examples/rental-model/basic/vpn.ts | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/core-api/manual-pools.ts b/examples/core-api/manual-pools.ts index e0c4a9472..6e0d2e11a 100644 --- a/examples/core-api/manual-pools.ts +++ b/examples/core-api/manual-pools.ts @@ -26,7 +26,7 @@ const demandOptions = { (async () => { const logger = pinoPrettyLogger({ - level: "debug", + level: "info", }); const glm = new GolemNetwork({ diff --git a/examples/core-api/override-module.ts b/examples/core-api/override-module.ts index da155d420..f71ffd5d4 100644 --- a/examples/core-api/override-module.ts +++ b/examples/core-api/override-module.ts @@ -43,7 +43,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), // here's where we provide our own implementation override: { diff --git a/examples/core-api/step-by-step.ts b/examples/core-api/step-by-step.ts index c63d11cf0..5ec4e30a9 100644 --- a/examples/core-api/step-by-step.ts +++ b/examples/core-api/step-by-step.ts @@ -17,7 +17,7 @@ import { filter, map, switchMap, take } from "rxjs"; (async () => { const logger = pinoPrettyLogger({ - level: "debug", + level: "info", }); const glm = new GolemNetwork({ diff --git a/examples/docs-examples/quickstarts/quickstart/requestor.mjs b/examples/docs-examples/quickstarts/quickstart/requestor.mjs index 9b1b9cbcf..f1ffeca85 100644 --- a/examples/docs-examples/quickstarts/quickstart/requestor.mjs +++ b/examples/docs-examples/quickstarts/quickstart/requestor.mjs @@ -23,7 +23,7 @@ const order = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), api: { key: "try_golem" }, }); diff --git a/examples/experimental/deployment/new-api.ts b/examples/experimental/deployment/new-api.ts index bdac115ca..607e049bd 100644 --- a/examples/experimental/deployment/new-api.ts +++ b/examples/experimental/deployment/new-api.ts @@ -5,7 +5,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; async function main() { const golem = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/advanced/local-image/serveLocalGvmi.ts b/examples/rental-model/advanced/local-image/serveLocalGvmi.ts index 5b58909f1..3c4503539 100644 --- a/examples/rental-model/advanced/local-image/serveLocalGvmi.ts +++ b/examples/rental-model/advanced/local-image/serveLocalGvmi.ts @@ -10,7 +10,7 @@ const getImagePath = (path: string) => new URL(path, import.meta.url).toString() (async () => { const logger = pinoPrettyLogger({ - level: "debug", + level: "info", }); const glm = new GolemNetwork({ diff --git a/examples/rental-model/advanced/payment-filters.ts b/examples/rental-model/advanced/payment-filters.ts index 19f7f75af..ff1b28092 100644 --- a/examples/rental-model/advanced/payment-filters.ts +++ b/examples/rental-model/advanced/payment-filters.ts @@ -55,7 +55,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/advanced/proposal-filter.ts b/examples/rental-model/advanced/proposal-filter.ts index cca13143e..a9599ed59 100644 --- a/examples/rental-model/advanced/proposal-filter.ts +++ b/examples/rental-model/advanced/proposal-filter.ts @@ -29,7 +29,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/advanced/proposal-predefined-filter.ts b/examples/rental-model/advanced/proposal-predefined-filter.ts index 8fc8f2ea8..cee05be92 100644 --- a/examples/rental-model/advanced/proposal-predefined-filter.ts +++ b/examples/rental-model/advanced/proposal-predefined-filter.ts @@ -27,7 +27,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/advanced/proposal-selector.ts b/examples/rental-model/advanced/proposal-selector.ts index 3dc6437ac..fa818cebb 100644 --- a/examples/rental-model/advanced/proposal-selector.ts +++ b/examples/rental-model/advanced/proposal-selector.ts @@ -35,7 +35,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/advanced/reuse-allocation.ts b/examples/rental-model/advanced/reuse-allocation.ts index 63d0580d2..e2b212b18 100644 --- a/examples/rental-model/advanced/reuse-allocation.ts +++ b/examples/rental-model/advanced/reuse-allocation.ts @@ -16,7 +16,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/basic/events.ts b/examples/rental-model/basic/events.ts index c6c9260af..9c6462d35 100644 --- a/examples/rental-model/basic/events.ts +++ b/examples/rental-model/basic/events.ts @@ -7,7 +7,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), payment: { driver: "erc20", diff --git a/examples/rental-model/basic/many-of.ts b/examples/rental-model/basic/many-of.ts index 6f3b1c0e5..7f381eb33 100644 --- a/examples/rental-model/basic/many-of.ts +++ b/examples/rental-model/basic/many-of.ts @@ -23,7 +23,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/basic/one-of.ts b/examples/rental-model/basic/one-of.ts index 8b1e06482..214145c3b 100644 --- a/examples/rental-model/basic/one-of.ts +++ b/examples/rental-model/basic/one-of.ts @@ -19,7 +19,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/basic/run-and-stream.ts b/examples/rental-model/basic/run-and-stream.ts index 4906b826b..a573c9643 100644 --- a/examples/rental-model/basic/run-and-stream.ts +++ b/examples/rental-model/basic/run-and-stream.ts @@ -24,7 +24,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/basic/transfer.ts b/examples/rental-model/basic/transfer.ts index 52238aa25..4874c4f0a 100644 --- a/examples/rental-model/basic/transfer.ts +++ b/examples/rental-model/basic/transfer.ts @@ -20,7 +20,7 @@ const order: MarketOrderSpec = { (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); diff --git a/examples/rental-model/basic/vpn.ts b/examples/rental-model/basic/vpn.ts index ef36ca5ca..c93351d10 100644 --- a/examples/rental-model/basic/vpn.ts +++ b/examples/rental-model/basic/vpn.ts @@ -4,7 +4,7 @@ import { pinoPrettyLogger } from "@golem-sdk/pino-logger"; (async () => { const glm = new GolemNetwork({ logger: pinoPrettyLogger({ - level: "debug", + level: "info", }), }); From 3d2ba0427f7a9ce38a3f38048668e68fc4ebc99a Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 17 Jul 2024 10:32:35 +0200 Subject: [PATCH 20/22] chore(deps): updated @golem-sdk/pino-logger lib to latest version --- package-lock.json | 7 ++++--- package.json | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index db0279125..c812c221d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "examples/" ], "dependencies": { + "@golem-sdk/pino-logger": "^1.1.0", "async-lock": "^1.4.1", "async-retry": "^1.3.3", "axios": "^1.6.7", @@ -1459,9 +1460,9 @@ "link": true }, "node_modules/@golem-sdk/pino-logger": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@golem-sdk/pino-logger/-/pino-logger-1.0.3.tgz", - "integrity": "sha512-P9BMJ+QUlWx7C+4iku/SOnNnjzGGBEhaHtOf4IDXrtvpEg8zqxEuyw5mM7PXpAr7HU/5C/f2BcBG39i7QYfwsw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@golem-sdk/pino-logger/-/pino-logger-1.1.0.tgz", + "integrity": "sha512-FxVqTnx7ToKPCABzfEHhwXT2x/B4PWez6y6AG9AeMjH9DA/itY8kclv0DUgWPPRTW4jr1Qrf6ovZYLhPZ5o3Dw==", "dependencies": { "pino": "^8.20.0", "pino-pretty": "^11.0.0" diff --git a/package.json b/package.json index 5298950b3..72ca267f1 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "node": ">=18.0.0" }, "dependencies": { + "@golem-sdk/pino-logger": "^1.1.0", "async-lock": "^1.4.1", "async-retry": "^1.3.3", "axios": "^1.6.7", From 5479ae9c58399b298b50751a9fd352ca69d3efa8 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 17 Jul 2024 10:34:54 +0200 Subject: [PATCH 21/22] test: fixed failing unit test --- src/market/market.module.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/market/market.module.test.ts b/src/market/market.module.test.ts index ee18e0ec6..14a9abe49 100644 --- a/src/market/market.module.test.ts +++ b/src/market/market.module.test.ts @@ -441,7 +441,6 @@ describe("Market module", () => { const goodProposal = {} as OfferProposal; const mockPool = mock(DraftOfferProposalPool, MockPropertyPolicy.StubAsProperty); - when(mockPool.remove(_)).thenResolve(); when(mockPool.acquire(_)).thenResolve(badProposal0).thenResolve(badProposal1).thenResolve(goodProposal); const goodAgreement = {} as Agreement; const marketSpy = spy(marketModule); From f399bcaded4fa1ffc6dc38c572b26e873a8e0c90 Mon Sep 17 00:00:00 2001 From: Grzegorz Godlewski Date: Wed, 17 Jul 2024 10:47:39 +0200 Subject: [PATCH 22/22] refactor: test cleanup --- src/market/market.module.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/market/market.module.test.ts b/src/market/market.module.test.ts index 14a9abe49..c91634fa0 100644 --- a/src/market/market.module.test.ts +++ b/src/market/market.module.test.ts @@ -1,4 +1,4 @@ -import { _, imock, instance, mock, MockPropertyPolicy, reset, spy, verify, when } from "@johanblumenberg/ts-mockito"; +import { _, imock, instance, mock, reset, spy, verify, when } from "@johanblumenberg/ts-mockito"; import { Logger, YagnaApi } from "../shared/utils"; import { MarketModuleImpl } from "./market.module"; import { Demand, DemandSpecification } from "./demand"; @@ -440,7 +440,7 @@ describe("Market module", () => { const badProposal1 = {} as OfferProposal; const goodProposal = {} as OfferProposal; - const mockPool = mock(DraftOfferProposalPool, MockPropertyPolicy.StubAsProperty); + const mockPool = mock(DraftOfferProposalPool); when(mockPool.acquire(_)).thenResolve(badProposal0).thenResolve(badProposal1).thenResolve(goodProposal); const goodAgreement = {} as Agreement; const marketSpy = spy(marketModule);