Skip to content

test(e2e): use plain ApifyClient for platform result reads#3776

Open
B4nan wants to merge 1 commit into
masterfrom
claude/crazy-hellman-e9cf8b
Open

test(e2e): use plain ApifyClient for platform result reads#3776
B4nan wants to merge 1 commit into
masterfrom
claude/crazy-hellman-e9cf8b

Conversation

@B4nan

@B4nan B4nan commented Jun 23, 2026

Copy link
Copy Markdown
Member

What & why

The scheduled PLATFORM E2E run started failing on every dataset-reading test with Error: ChargingManager is not initialized (example run).

Root cause is an apify SDK change (3.7.2): Actor.newClient() now returns a charging-aware client whose .dataset() getter unconditionally calls Actor.getChargingManager().getPricingInfo(), which throws when the Actor was never initialized. The PLATFORM harness runs the Actor on the platform and never calls Actor.init() in the local process, so client.dataset(...).listItems() blew up.

The one PLATFORM test that doesn't read a dataset (request-queue-with-concurrency) kept passing, confirming the cause.

Fix

Use a plain ApifyClient (re-exported by apify) for the read-only result-gathering path, bypassing the charging patch. request-queue-with-concurrency keeps using Actor.newClient() since it never touches a dataset.

@github-actions github-actions Bot added this to the 143rd sprint - Tooling team milestone Jun 23, 2026
@github-actions github-actions Bot added t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics. labels Jun 23, 2026
The apify SDK (3.7.2) changed `Actor.newClient()` to return a
charging-aware client whose `.dataset()` getter calls
`Actor.getChargingManager().getPricingInfo()`, which throws
"ChargingManager is not initialized" when the Actor was never
initialized. The PLATFORM e2e harness runs the Actor on the platform
and never calls `Actor.init()` locally, so reading dataset results via
`client.dataset(...).listItems()` started failing for every test.

Use a plain `ApifyClient` (re-exported by apify) for the read-only
result-gathering path instead, bypassing the charging patch.
@B4nan B4nan force-pushed the claude/crazy-hellman-e9cf8b branch from 2982b2b to de7ada8 Compare June 23, 2026 07:44
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Jun 23, 2026
@B4nan

B4nan commented Jun 23, 2026

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants