Skip to content

Migrate tests/purge_dlq_tasks_api_test.go#10339

Open
stephanos wants to merge 1 commit into
mainfrom
stephanos/onebox-purge-dlq
Open

Migrate tests/purge_dlq_tasks_api_test.go#10339
stephanos wants to merge 1 commit into
mainfrom
stephanos/onebox-purge-dlq

Conversation

@stephanos
Copy link
Copy Markdown
Contributor

@stephanos stephanos commented May 19, 2026

What changed

Migrate tests/purge_dlq_tasks_api_test.go to parallelsuite/testEnv; also also remove its use of WithFxOptionsForService by allowing to inject custom errors into persistence calls.

Why

We want to eliminate WithFxOptionsForService as it is blocking us from migrating away from the onebox.go approach (which duplicates the fx setup) since we don't want to expose an equivalent method in temporal/fx.go.

@stephanos stephanos changed the title Refactor purge DLQ task test setup Migrate tests/purge_dlq_tasks_api_test.go May 19, 2026
@stephanos stephanos force-pushed the stephanos/onebox-purge-dlq branch 12 times, most recently from 9e3ad7a to 5fe2c03 Compare May 19, 2026 23:42
Comment thread common/config/config.go

FaultInjectionTarget struct {
Store DataStoreName
Method string
Copy link
Copy Markdown
Contributor Author

@stephanos stephanos May 19, 2026

Choose a reason for hiding this comment

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

This could be extended later, but it's sufficient for now

@stephanos stephanos force-pushed the stephanos/onebox-purge-dlq branch 7 times, most recently from fd2cec1 to e862ccc Compare May 20, 2026 00:06
@stephanos stephanos force-pushed the stephanos/onebox-purge-dlq branch from e862ccc to 58872dc Compare May 20, 2026 00:06
@stephanos stephanos marked this pull request as ready for review May 20, 2026 00:09
@stephanos stephanos requested review from a team as code owners May 20, 2026 00:09
@stephanos stephanos requested a review from spkane31 May 20, 2026 00:09
@stephanos stephanos removed the request for review from spkane31 May 20, 2026 00:09
},
{
name: "DeleteTasksUnavailableError",
configure: func(p *purgeDLQTasksTestParams) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that this test wasn't actually testing the error case ...

Comment thread common/config/config.go
Targets FaultInjectionTargets `yaml:"targets"`

// Injector optionally injects faults using runtime code instead of static YAML config.
Injector FaultInjector `yaml:"-" json:"-"`
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This allows us to inject arbitrary persistence errors from functional tests.

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.

1 participant