-
Notifications
You must be signed in to change notification settings - Fork 41
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
MM-50808: Add versions to actions #565
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
frequency: 4, | ||
run: switchChannel, | ||
frequency: 4, | ||
minServerVersion: initialVersion, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we could have defaulted to no/empty version meaning initialVersion
to avoid adding this everywhere, unless we really want to be explicit.
@@ -54,6 +55,9 @@ func New(id int, user user.User, config *Config, status chan<- control.UserStatu | |||
}, nil | |||
} | |||
|
|||
// All requests are based in API v4, so the absolute minimum version required is 4.0.0 | |||
var initialVersion = semver.MustParse("4.0.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not very strong opinions on this but I am not sure it would make a lot of sense to support anything prior to v5. This repository was created around 5.17 time and I don't believe it was ever executed against previous versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, and if we are not going to test again a certain version. I think it's just better to restrict.
@@ -980,7 +980,7 @@ func (s *MemStore) ServerVersion() (string, error) { | |||
return s.serverVersion, nil | |||
} | |||
|
|||
// SetProfileImage sets as stored the profile image for the given user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was good at copy pasting 🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Running a smoke-test in Postgres. I'll merge as soon as it finishes. |
Status update on this: I did run the tests, but I had so many errors that the server ended up crashing. With the rest of the work going on, I didn't have a chance to properly debug it, so this is paused until I have some time to find the root cause (which I suspect is related to version-specific code inside some actions that, although cover old endpoints, should only be executed in more modern versions). |
I'm thinking that we should aggressively simplify this PR. Following the decision on https://mattermost.atlassian.net/browse/MM-51011, where we avoided a specific change that would allow supporting versions prior to 6.0 because that version was out of support, we could set the minimum version for all actions to 6.3 (which is also out of support at this point, but still used by some customers). That version is known to work with the tool, and if there are some quirks to solve, they'll be more approachable than issues with 5.x versions. Thoughts, @agnivade, @streamer45? |
Make sense, also not opposed to support from the last supported ESR onwards. |
Yep agree. If customers want to run tests with older MM versions, they can use older releases. There is no need to maintain backwards incompatibility beyond the last ESR. |
f9cf8cf
to
899aa15
Compare
899aa15
to
baa5327
Compare
Rebased this on top of master to get it through the finish line, a year and a month later! It's basically the same as before, so the description in the PR still holds, except for the minimum supported version, which is, by definition, the third-to-last ESR. So, for now, 7.8, according to https://docs.mattermost.com/upgrade/extended-support-release.html#what-are-the-current-supported-extended-support-release-versions. Let me know if you need any more context! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, a couple of comments.
@@ -960,16 +961,16 @@ func ReloadGQL(u user.User) UserActionResponse { | |||
} | |||
} | |||
|
|||
ver, err := u.Store().ServerVersion() | |||
serverVersionString, err := u.Store().ServerVersion() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still support graphql?
WebSocketURL: "ws://localhost:8065", | ||
}) | ||
func TestNew(t *testing.T) { | ||
c, _ := newController(t) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if we just close the chan after this :p
@agarciamontoro Given the above, do we still need all these checks against version 6.4.0? |
Summary
When running newer versions of the load-test against older versions of Mattermost, many of the actions that the agents perform are not implemented in the server, which artificially increases the rate of errors.
Fortunately, the
userAction
struct insimulcontroller
already had this logic implemented: setting theminServerVersion
in the actions, they are performed only when the server's version is greater than or equal to it.Unfortunately, none of the actions had this field set, so all actions were running for all versions.
This PR adds the minimum server version to each action. Some comments:
I've made a couple of additional changes:
minServerVersion
is no longerstring
, butsemver.Version
. We were parsing these strings every time we ran an action, so I decided to usesemver.MustParse
once when we initialize the versions. Then we can skip all additional parsings, which reduces the number of errors we can get.simulcontroller.serverVersion
. It is parsed once when it is initialized (this time it can error, we cannot do asemver.MustParse
since it's an external value), and used as asemver.Version
elsewhere.simulcontroller
now checks at the beginning whether the server version is at least 4.0.0. Just some defensive code in case someone tries to load-test a very old server.I recommend you review by commit, it will be easier to understand the changes, and the messages should be self-explanatory.
I'm gonna start a test with older versions and see how this behaves.
Ticket Link
https://mattermost.atlassian.net/browse/MM-50808