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-343: Fix concurrent write panic for parallel test #545

Merged
merged 5 commits into from
Feb 13, 2025

Conversation

samuel27m
Copy link
Member

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 #472

h.invokeHistory.Store(req.GetWorkflowStateId()+"_start", value.(int64)+1)
} else {
h.invokeHistory.Store(req.GetWorkflowStateId()+"_start", int64(1))
}
Copy link
Member Author

@samuel27m samuel27m Feb 12, 2025

Choose a reason for hiding this comment

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

I couldn't reproduce the issue described in #472, but I can see that this issue could very well happen due to the nature of the Workflow in this test.

Looking for opinions on if this is something that we need to polish a bit more, and if we want to make all our other tests also use sync.Map for storing the current invokeHistory in the integration tests to avoid this issue in the future too

Copy link
Member Author

@samuel27m samuel27m Feb 12, 2025

Choose a reason for hiding this comment

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

As discussed today, I have now applied the same logic now for all the tests. i.e. all tests now use sync.Map which can be written to concurrently

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.08%. Comparing base (333e351) to head (f6a4227).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #545      +/-   ##
==========================================
+ Coverage   66.06%   66.08%   +0.02%     
==========================================
  Files          62       62              
  Lines        6927     6927              
==========================================
+ Hits         4576     4578       +2     
+ Misses       2072     2070       -2     
  Partials      279      279              

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

@@ -10,7 +10,7 @@ import (
"time"

"github.com/indeedeng/iwf/gen/iwfidl"
anycommandconbination "github.com/indeedeng/iwf/integ/workflow/any_command_combination"
anycommandcombination "github.com/indeedeng/iwf/integ/workflow/any_command_combination"
Copy link
Member Author

Choose a reason for hiding this comment

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

This was just a typo that I noticed while working on the tests

@samuel27m samuel27m enabled auto-merge (squash) February 13, 2025 12:00
@samuel27m samuel27m merged commit 6249778 into main Feb 13, 2025
8 checks passed
@samuel27m samuel27m deleted the jira/scacador/IWF-343 branch February 13, 2025 12:14
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.

Fix concurrent write panic for parallel test
2 participants