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

IWF-475: Cleanup unnecessary waiting in integ tests and add wait comments #549

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

stevo89519
Copy link
Contributor

…ents

Description

Checklist

  • Code compiles correctly
  • Tests for the changes have been added
  • All tests passing
  • This PR change is backwards-compatible
  • This PR CONTAINS a (planned) breaking change (it is not backwards compatible)

Related Issue

Closes #issue_number

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.06%. Comparing base (e103716) to head (a52e787).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #549   +/-   ##
=======================================
  Coverage   66.06%   66.06%           
=======================================
  Files          62       62           
  Lines        6927     6927           
=======================================
  Hits         4576     4576           
  Misses       2072     2072           
  Partials      279      279           

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

@@ -197,7 +199,7 @@ func doTestTimerWorkflow(t *testing.T, backendType service.BackendType, config *
timer3.Status = service.TimerSkipped
assertTimerQueryResponseEqual(assertions, expectedTimerInfos, timerInfos)

// wait for the workflow
// Wait for the workflow
Copy link
Contributor

Choose a reason for hiding this comment

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

// Wait for the workflow to complete

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated here and a good handful of other places with the same comment.

@@ -115,8 +117,9 @@ func doTestDeadEndWorkflow(t *testing.T, backendType service.BackendType, config
failTestAtHttpError(err, httpResp, t)
}

// Short wait for workflow
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add more info here to what we expect from this wait?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@@ -103,6 +103,7 @@ func doTestGreedyTimerWorkflowCustomConfig(t *testing.T, backendType service.Bac
}).Execute()
failTestAtHttpError(err, httpResp, t)

// Short wait for workflow to initialize
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about these three

  1. L106: This is after starting a workflow, but it's a sync operation, since the response returns workflowId meaning the workflow has been intialized
  2. L129: No workflow start right before it
  3. L181: No workflow start right before it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@@ -129,7 +129,7 @@ func doTestAnyCommandCombinationWorkflow(t *testing.T, backendType service.Backe
}).Execute()
failTestAtHttpError(err, httpResp, t)

// wait and check the workflow, it should be still running
// Wait and check the workflow, it should be still running
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this one adds delay to make sure the timer has been skipped before moving on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated comment and moved wait up to where it is more relevant.

Comment on lines +77 to +81
reqWait := apiClient.DefaultApi.ApiV1WorkflowGetWithWaitPost(context.Background())
_, httpResp, err = reqWait.WorkflowGetRequest(iwfidl.WorkflowGetRequest{
WorkflowId: wfId,
}).Execute()
failTestAtHttpError(err, httpResp, t)
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove L98+ since the workflow will be completed before moving on to the assertions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed unneeded code

Comment on lines +77 to +81
reqWait := apiClient.DefaultApi.ApiV1WorkflowGetWithWaitPost(context.Background())
_, httpResp, err = reqWait.WorkflowGetRequest(iwfidl.WorkflowGetRequest{
WorkflowId: wfId,
}).Execute()
failTestAtHttpError(err, httpResp, t)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as integ/wf_state_options_data_attributes_loading_test.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed unneeded code

@stevo89519
Copy link
Contributor Author

@lwolczynski I pushed a commit based on your comments. Thanks.

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