如何将区域端点添加到 pub sub 模拟器
我正在测试 pub 子区域失败。
所以我只需要一个区域主题。如果我用另一个端点 ping 同一主题,它应该会失败。我正在用模拟器测试。但在模拟器中无法添加区域端点。那我该如何测试呢?
我正在测试一种场景,我可以检查一个区域是否已关闭,我可以将消息发送到另一个区域。
I am testing pub sub region failure.
So I only need one region topic up. And if I ping the same topic with another endpoint , it should fail. I am testing with emulator. But in emulator there is no way to add regional endpoints. How can I test this then ?
I am testing a scenario where I can check if one region is down , I can send the message to the other region.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是模拟器旨在测试的场景。与仿真器通信需要将联系人地址更改为仿真器的地址。当设置模拟器环境变量时,某些客户端库会在内部执行此操作。
即使它确实允许您指定区域端点,它也无法有选择地拒绝来自一个地址而不是另一个地址的请求。
我不确定这是否是需要模拟器的场景,因为这些测试的真正目的是确保考虑到发布/订阅服务本身的工作方式正确的行为。在这种情况下,您只需要测试对 RPC 失败的反应是否符合预期,因此您可以使用为您正在使用的语言设计的库来伪造错误响应,并确保在初始请求时将请求发送到不同的区域。失败则返回。
This is not a scenario that the emulator is designed to test. Communicating with the emulator requires one to change the address one contacts to be the address of the emulator. Some client libraries do this internally when the emulator environment variable is set.
Even if it did allow you to specify regional endpoints, it wouldn't have a way to selectively reject requests that come in on one address and not the other.
I'm not sure this is the kind of scenario that requires the emulator as those tests are really designed to ensure proper behavior given the way the Pub/Sub service itself works. In this case, you need only test that the reaction to RPC failures is as expected, so you could fake error responses using libraries designed for such things in the language you are using and ensure that you then send requests to a different region when those initial failures are returned.