Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ workers/java/build
/last_fuzz_run.proto
workers/dotnet/Temporalio.Omes.temp.csproj

workers/python/**/__pycache__/
workers/*/omes-temp-*/
workers/*/prepared/

Expand Down
4 changes: 0 additions & 4 deletions loadgen/helper_historyrequire.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,6 @@ func looselyEqual(x, y any) bool {
return reflect.DeepEqual(x, y)
}

func formatEventTypeName(event *historypb.HistoryEvent) string {
return strings.TrimPrefix(event.GetEventType().String(), "EVENT_TYPE_")
}

func logHistoryMismatch(t *testing.T, expectedSpec string, actualEvents eventList) {
t.Helper()

Expand Down
58 changes: 52 additions & 6 deletions loadgen/kitchen-sink-gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use crate::protos::temporal::{
HandlerInvocation, RemoteActivityOptions, ReturnResultAction, SetPatchMarkerAction,
TestInput, TimerAction, UpsertMemoAction, UpsertSearchAttributesAction, WithStartClientAction,
WorkflowInput, WorkflowState,
execute_activity_action::{ClientActivity, PayloadActivity},
},
};
use anyhow::Error;
Expand Down Expand Up @@ -581,13 +582,28 @@ impl<'a> Arbitrary<'a> for ExecuteActivityAction {
} else {
execute_activity_action::Locality::IsLocal(())
};
let delay = u.int_in_range(0..=1_000)?;

let activity_type_choice = u.int_in_range(1..=100)?;
let activity_type = match activity_type_choice {
1..=85 => {
let delay = u.int_in_range(0..=1_000)?;
execute_activity_action::ActivityType::Delay(
Duration::from_millis(delay)
.try_into()
.expect("proto duration works"),
)
}
86..=90 => {
execute_activity_action::ActivityType::Payload(u.arbitrary()?)
}
91..=100 => {
execute_activity_action::ActivityType::Client(u.arbitrary()?)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Including the new client activity.

}
_ => unreachable!(),
};

Ok(Self {
activity_type: Some(execute_activity_action::ActivityType::Delay(
Duration::from_millis(delay)
.try_into()
.expect("proto duration works"),
)),
activity_type: Some(activity_type),
start_to_close_timeout: Some(Duration::from_secs(5).try_into().unwrap()),
locality: Some(locality),
awaitable_choice: Some(u.arbitrary()?),
Expand Down Expand Up @@ -691,6 +707,36 @@ impl<'a> Arbitrary<'a> for UpsertSearchAttributesAction {
}
}

impl<'a> Arbitrary<'a> for ClientActivity {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let client_sequence = ClientSequence {
action_sets: vec![ClientActionSet {
actions: vec![u.arbitrary()?],
concurrent: false,
Copy link
Member

Choose a reason for hiding this comment

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

Should this be allowed to be true? Seemingly the support is already there?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The support for Go is there but the support for the other SDKs isn't there yet. #188 will only add support for non-current client activity there.

wait_at_end: None,
wait_for_current_run_to_finish_at_end: false,
}],
};

Ok(Self {
client_sequence: Some(client_sequence),
})
}
}


impl<'a> Arbitrary<'a> for PayloadActivity {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
let max_payload_size = ARB_CONTEXT.with_borrow(|c| c.config.max_payload_size) as i32;

Ok(Self {
bytes_to_receive: u.int_in_range(0..=max_payload_size)?,
bytes_to_return: u.int_in_range(0..=max_payload_size)?,
})
}
}


impl<'a> Arbitrary<'a> for RemoteActivityOptions {
fn arbitrary(u: &mut Unstructured<'a>) -> arbitrary::Result<Self> {
Ok(RemoteActivityOptions {
Expand Down
Loading
Loading