Skip to content

feat(processor): pyt test-pod deployer sets PYT_MODE=test - #7506

Merged
fracasula merged 3 commits into
masterfrom
feature/pipe-3554-02-rudder-server-test-pod-deployer-sets-pyt_modetest
Oct 22, 2026
Merged

fracasula merged 3 commits into
masterfrom
feature/pipe-3554-02-rudder-server-test-pod-deployer-sets-pyt_modetest

Conversation

@fracasula

@fracasula fracasula commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

pyt pods will soon serve only their own mode's endpoints and refuse everything else with 421 Misdirected Request (PIPE-3552). Each pod learns its mode from PYT_MODE. This PR makes every ephemeral test pod the pyt test deployer creates start with PYT_MODE=test.

Why in code, not config: the deployer is the only thing that creates test pods. Setting the mode there means no config can leave a test pod without a mode or give it the wrong one. This matters because the operator builds pytTestEnv by merging in the production pyt pod's extraEnvVars, so a mode set there for traffic pods would otherwise reach test pods too.

What changes:

  • PYT_MODE=test: set by the deployer next to WORKSPACE_ID.
  • How the deployer's own vars win: envVars now takes them as a second argument and sets them after uppercasing the config-provided names. The config layer lowercases map keys, so a configured PYT_MODE arrives as pyt_mode. Applied last, the deployer's value wins whatever case a configured key has. WORKSPACE_ID moved to the same mechanism, which replaces its delete(env, "workspace_id") workaround.

Ordering: today's pyt ignores PYT_MODE. After PIPE-3559, pyt refuses to start without a mode, so this must be live everywhere first (gate: PIPE-3558).

Testing:

  • Covered: the container env is exactly PYT_MODE=test plus WORKSPACE_ID with no env configured, with config setting pyt_mode: traffic, and with config setting it empty. The same subtest checks that the configured env map is left untouched: the reloadable config hands every concurrent run the same map, so a deployer that wrote to it (for example to delete a key) would race with other runs.
  • Checked by breaking it: dropping PYT_MODE, and applying the deployer's vars before the config's, each fail the new test. Setting them last also makes that failure deterministic: with a delete-the-lowercased-key approach, a missing delete leaves two keys colliding in random map order, so a test would catch it only some of the time.
  • Run locally: go test -race and golangci-lint for processor/internal/pytdeployer.

Linear Ticket

Fixes PIPE-3554

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.08%. Comparing base (e1c9d38) to head (fe5a1ae).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7506      +/-   ##
==========================================
+ Coverage   84.63%   85.08%   +0.44%     
==========================================
  Files         632      632              
  Lines       62877    62874       -3     
==========================================
+ Hits        53217    53496     +279     
+ Misses       9657     9375     -282     
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fracasula
fracasula marked this pull request as ready for review October 20, 2026 12:15
@fracasula
fracasula merged commit a050ed6 into master Oct 22, 2026
74 checks passed
@fracasula
fracasula deleted the feature/pipe-3554-02-rudder-server-test-pod-deployer-sets-pyt_modetest branch October 22, 2026 12:34
itsmihir pushed a commit that referenced this pull request Oct 26, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.92.0-rc.1](v1.91.0...v1.92.0-rc.1)
(2026-10-26)


### Features

* **processor:** pyt test-pod deployer sets PYT_MODE=test
([#7506](#7506))
([a050ed6](a050ed6))
* **processor:** reset the per-workspace pyt client on 421
([#7494](#7494))
([83db4d6](83db4d6))
* **router:** re-fetch the cached OAuth token when the control plane
holds a newer secret (PRO-5947)
([#7478](#7478))
([742779d](742779d))
* **router:** tag oauth_action counters with destinationId and count
AUTH_STATUS_INACTIVE (PRO-5946)
([#7477](#7477))
([0e15eb4](0e15eb4))


### Bug Fixes

* flaky TestDrainConfigRoutine failing with "database is closed"
([#7489](#7489))
([9baa89f](9baa89f))


### Miscellaneous

* block new ginkgo/gomega usage in tests
([#7502](#7502))
([e1c9d38](e1c9d38))
* bump dependency versions
([#7522](#7522))
([1067ff4](1067ff4))
* enforce errors.AsType and point CLAUDE.md at AGENTS.md
([#7521](#7521))
([5c7e088](5c7e088))
* go 1.27.3
([#7516](#7516))
([3c240a3](3c240a3))
* migrate debugger, services, async destination and utils tests from
ginkgo to testify
([#7503](#7503))
([1a8c85a](1a8c85a))
* migrate gateway, rsources, reporting, batchrouter and manager tests
from ginkgo to testify
([#7507](#7507))
([ffdd505](ffdd505))
* remove ginkgo and gomega from tests
([#7508](#7508))
([d3e7e0f](d3e7e0f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
itsmihir pushed a commit that referenced this pull request Oct 27, 2026
🤖 I have created a release *beep* *boop*
---


##
[1.92.0](v1.91.0...v1.92.0)
(2026-10-26)


### Features

* **processor:** pyt test-pod deployer sets PYT_MODE=test
([#7506](#7506))
([a050ed6](a050ed6))
* **processor:** reset the per-workspace pyt client on 421
([#7494](#7494))
([83db4d6](83db4d6))
* **router:** re-fetch the cached OAuth token when the control plane
holds a newer secret (PRO-5947)
([#7478](#7478))
([742779d](742779d))
* **router:** tag oauth_action counters with destinationId and count
AUTH_STATUS_INACTIVE (PRO-5946)
([#7477](#7477))
([0e15eb4](0e15eb4))


### Bug Fixes

* flaky TestDrainConfigRoutine failing with "database is closed"
([#7489](#7489))
([9baa89f](9baa89f))


### Miscellaneous

* block new ginkgo/gomega usage in tests
([#7502](#7502))
([e1c9d38](e1c9d38))
* bump dependency versions
([#7522](#7522))
([1067ff4](1067ff4))
* enforce errors.AsType and point CLAUDE.md at AGENTS.md
([#7521](#7521))
([5c7e088](5c7e088))
* go 1.27.3
([#7516](#7516))
([3c240a3](3c240a3))
* migrate debugger, services, async destination and utils tests from
ginkgo to testify
([#7503](#7503))
([1a8c85a](1a8c85a))
* migrate gateway, rsources, reporting, batchrouter and manager tests
from ginkgo to testify
([#7507](#7507))
([ffdd505](ffdd505))
* remove ginkgo and gomega from tests
([#7508](#7508))
([d3e7e0f](d3e7e0f))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
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.

3 participants