Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tesla.Mock.pdict_get/0 doesn't work inside of Broadway #681

Closed
cfbender opened this issue Jun 18, 2024 · 3 comments
Closed

Tesla.Mock.pdict_get/0 doesn't work inside of Broadway #681

cfbender opened this issue Jun 18, 2024 · 3 comments

Comments

@cfbender
Copy link

Finding an issue with #668 as of 1.10.0 on our project. Something with running pdict_get/0 inside of a process that Broadway owns returns an atom for pid_holder:
image

leading to the following error:

[error] ** (ArgumentError) errors were found at the given arguments:

  * 1st argument: not a pid

    :erlang.process_info(:"Broadway1.Broadway.ProcessorSupervisor")
    (elixir 1.16.2) lib/process.ex:839: Process.info/1
    (tesla 1.10.0) lib/tesla/mock.ex:238: Tesla.Mock.pdict_get/0
    (tesla 1.10.0) lib/tesla/mock.ex:204: Tesla.Mock.call/2
    (tesla_mock 0.1.0) lib/consumer.ex:20: MyBroadway.handle_message/3
    (broadway 1.0.7) lib/broadway/topology/processor_stage.ex:159: anonymous fn/6 in Broadway.Topology.ProcessorStage.handle_messages/4
    (telemetry 1.2.1) /Users/cfb/code/playground/tesla_mock/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
    (broadway 1.0.7) lib/broadway/topology/processor_stage.ex:146: Broadway.Topology.ProcessorStage.handle_messages/4
    (broadway 1.0.7) lib/broadway/topology/processor_stage.ex:65: anonymous fn/2 in Broadway.Topology.ProcessorStage.handle_events/3
    (telemetry 1.2.1) /Users/cfb/code/playground/tesla_mock/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
    (gen_stage 1.2.1) lib/gen_stage.ex:2578: GenStage.consumer_dispatch/6
    (gen_stage 1.2.1) lib/gen_stage.ex:2767: GenStage.take_pc_events/3
    (stdlib 5.2.3) gen_server.erl:1095: :gen_server.try_handle_info/3
    (stdlib 5.2.3) gen_server.erl:1183: :gen_server.handle_msg/6
    (stdlib 5.2.3) proc_lib.erl:241: :proc_lib.init_p_do_apply/3

I have set up a minimal reproduction here, as I couldn't get it to reproduce in the unit tests in this library in my fork: https://github.com/cfbender/tesla_mock_example

Hope this helps! We will just pin to 1.9.0 for now

@yordis
Copy link
Member

yordis commented Jun 19, 2024

Could this be solved with #683

@yordis
Copy link
Member

yordis commented Jun 19, 2024

I related https://github.com/elixir-tesla/tesla/releases/tag/v1.10.1, which may fix the issue; please reopen if that didn't work, or much better, send a pull request; you have my support with it.

@yordis yordis closed this as completed Jun 19, 2024
@cfbender
Copy link
Author

@yordis that should work, I was testing a similar fix on my fork locally. Thanks so much for the prompt response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants