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

test: sync replicas in ModuleProcessSpecManager.sync_from_desc #1682

Merged
merged 3 commits into from
Oct 30, 2024

Conversation

jamesgetx
Copy link
Collaborator

@jamesgetx jamesgetx commented Oct 24, 2024

单测:测试 ModuleProcessSpecManager.sync_from_desc 方法中,同步副本数的逻辑

@jamesgetx jamesgetx requested a review from piglei October 24, 2024 12:01
[ProcessTmpl(name=proc_name, command="foo", replicas=replicas)]
)
spec = ModuleProcessSpec.objects.get(name=proc_name, module=bk_module)
assert spec.target_replicas == replicas or PROC_DEFAULT_REPLICAS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 .target_replicas 实际上还有意义吗,感觉对比了下面 get 两个环境的 replicas 就够了?这里有一个 or PROC_DEFAULT_REPLICAS 的逻辑会很奇怪,有点过于深入实现逻辑。

Copy link
Collaborator Author

@jamesgetx jamesgetx Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实这里的写法深入了实现逻辑,不符合测试的原则。已去除 target_replicas,单独验证 stag 和 prod 即可

@piglei piglei merged commit 3c39a4b into TencentBlueKing:main Oct 30, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants