Skip to content

Conversation

@stephanos
Copy link
Collaborator

@stephanos stephanos commented Aug 18, 2025

What was changed

Prelude for #179:

  • adds partial history matching (when full matching won't work)
  • scopes build logs to test run
  • runs kitchen sink tests in parallel
  • fixes data race
  • adds new end-to-end ThroughputStress test

Why?

Improve test experience.

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

- name: Test Kitchensink ${{ matrix.sdk }}
run: |
SDK=${{ matrix.sdk }} go test -race ./loadgen -run TestKitchensink -v
SDK=${{ matrix.sdk }} go test -race ./loadgen -run TestKitchenSink -v
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Renamed for consistency.

// WorkflowExecutionStarted {"taskQueue":"foo-bar"}
// ...
// WorkflowExecutionCompleted
type partialHistoryMatcher string
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Needed because some tests are not deterministic enough to run the full history matcher.

if executeErr != nil {
return fmt.Errorf("failed to execute kitchen sink workflow: %w", executeErr)
}
if clientActionsErr != nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Data race here.

if b.stdout == nil {
b.stdout = &logWriter{logger: b.Logger}
}
if b.stderr == nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

With these the build logs will be associated with the right test logs.

@@ -0,0 +1,190 @@
package kitchensink
Copy link
Collaborator Author

@stephanos stephanos Aug 18, 2025

Choose a reason for hiding this comment

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

Moved over here for discoverability (helpful once we have multiple impls).

EventID int64
Type string
Fields map[string]any
type event struct {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Some refactorings to make the events a typed entity.

},
} {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Parallel!

@stephanos stephanos force-pushed the test-refactor branch 2 times, most recently from 6b9875d to 5000aa8 Compare August 18, 2025 18:10
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.10.0
github.com/temporalio/features v0.0.0-20250714172315-c9d352c46b16
github.com/temporalio/features v0.0.0-20250808182149-bb2a99cdf200
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to pull in temporalio/features#662

@stephanos stephanos force-pushed the test-refactor branch 10 times, most recently from 99e32ae to 06abbb2 Compare August 18, 2025 18:45
"github.com/temporalio/omes/loadgen"
)

func TestThroughputStress(t *testing.T) {
Copy link
Collaborator Author

@stephanos stephanos Aug 18, 2025

Choose a reason for hiding this comment

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

New end-to-end test using the new test environment.

@stephanos stephanos force-pushed the test-refactor branch 7 times, most recently from d025a68 to ffe57f0 Compare August 18, 2025 18:58
@stephanos stephanos changed the title Refactor test helpers Extend test helpers Aug 18, 2025
WorkflowExecutionCompleted`),
},
{
name: "ClientSequence - Nested",
Copy link
Collaborator Author

@stephanos stephanos Aug 18, 2025

Choose a reason for hiding this comment

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

Example of a new test case that uses partialHistoryMatcher - more to follow.

return historyEvents
}

func ensureWorkerBuilt(t *testing.T, sdk cmdoptions.Language) error {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved all this into test helper.

@stephanos stephanos marked this pull request as ready for review August 18, 2025 19:07
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/stretchr/testify v1.10.0 // indirect
github.com/temporalio/features v0.0.0-20250808182149-bb2a99cdf200 // indirect
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Transitive dependency ...

@stephanos stephanos requested a review from Sushisource August 18, 2025 19:08
@stephanos stephanos force-pushed the test-refactor branch 7 times, most recently from 42b10f5 to f704727 Compare August 19, 2025 16:44
@stephanos stephanos requested a review from a team as a code owner August 19, 2025 16:44
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

I guess a bunch of this is in the Go Client activity type PR, yes? Just skimmed it b/c of that.

@stephanos
Copy link
Collaborator Author

stephanos commented Aug 27, 2025

Oh yeah, it's the same commit as in #179

@stephanos stephanos merged commit c537957 into main Aug 27, 2025
33 checks passed
@stephanos stephanos deleted the test-refactor branch August 27, 2025 16:59
stephanos added a commit that referenced this pull request Aug 27, 2025
ℹ️ This PR includes the #189 PR;
you can just look at the "Client ActivityType" commit for review.

<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR! 
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->

<!--- For ALL Contributors 👇 -->

## What was changed
<!-- Describe what has changed in this PR -->

Adds new "Client" ActivityType to execute client actions (e.g. Update,
Signal) from a workflow activity.

## Why?
<!-- Tell your future self why have you made these changes -->

- Keeps all action execution in one place (ie the workflow).
- Makes client actions part of the event history (free resume-ability,
easier debugging).
- Execution is (more) deterministic.

## Checklist
<!--- add/delete as needed --->

1. Closes <!-- add issue number here -->

2. How was this tested:
<!--- Please describe how you tested your changes/how we can test them
-->

3. Any docs updates needed?
<!--- update README if applicable
      or point out where to update docs.temporal.io -->
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