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

upgrade from more recent, 2.7 and 2.8 #9807

Merged
merged 34 commits into from Mar 13, 2024

Conversation

JComins000
Copy link
Contributor

@JComins000 JComins000 commented Mar 6, 2024

In this PR, I'm changing the fromVersions to be more recent so we can emulate customer upgrade paths better. Unfortunately, changing those upgrade paths also meant a lot of other changes to the upgradeTrigger test expectations and logic. I added some comments and moved some magic numbers to the top.

This issue was very difficult because pachyderm handles trigger commits differently after 2.7.x. We think verifying the file contents of each commit directly would be the best approach. That solution would require more time, and i've already got log messages with the file contents, so we think these changes are good enough for now.

In addition, I tried updating from 2.9.2 and got a new error.

    upgrade_test.go:245: No error is expected but got consistency error: parent branch default/TestTrigger_data@trigger commit is not in direct provenance of head of branch default/TestTrigger1@master

because I wasn't able to correctly verify 2.9.2, we want to reassign this test case to the PFS team to take a look and hopefully use waitCommit and file contents in their verification process. Here's the new issue.

@CLAassistant
Copy link

CLAassistant commented Mar 6, 2024

CLA assistant check
All committers have signed the CLA.

@djanicekpach djanicekpach self-requested a review March 7, 2024 18:33
src/testing/deploy/upgrade_test.go Outdated Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Show resolved Hide resolved
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.85%. Comparing base (d05ec5f) to head (590a2f9).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9807      +/-   ##
==========================================
- Coverage   59.31%   58.85%   -0.46%     
==========================================
  Files         586      586              
  Lines       70673    70673              
==========================================
- Hits        41917    41595     -322     
- Misses      28171    28545     +374     
+ Partials      585      533      -52     

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

return errors.New("not ready")
}
return nil
})
},
func(t *testing.T, ctx context.Context, c *client.APIClient, _ string) { /* postUpgrade */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

git doesn't do a good job with this diff because of an indentation change from this line in my new changes

			if semver.Compare("v"+from, "v2.8.0") < 0 {

Copy link
Member

@jrockway jrockway left a comment

Choose a reason for hiding this comment

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

I'm wary about changing the magic numbers. We should figure out how to rewrite the test so that they don't exist. Maybe it's a bug in the upgrade. cc: @acohen4 @brycemcanally

require.NoError(t, err)
expectedCommitCount := getExpectedCommitCountFromVersion(from)
Copy link
Member

Choose a reason for hiding this comment

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

I feel like pre-upgrade, this number should be stable. It should always be 11 or 12. I wonder what listCommits is returning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me add a log loop. let's see what happens

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/testing/deploy/upgrade_test.go Outdated Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Outdated Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Outdated Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Outdated Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Outdated Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Show resolved Hide resolved
src/testing/deploy/upgrade_test.go Show resolved Hide resolved
logCommits := func(t *testing.T, c *client.APIClient, commits []*pfs.CommitInfo) error {
var buf bytes.Buffer
for i, commit := range commits {
c.GetFile(commit.Commit, "/hello", &buf)
Copy link
Member

Choose a reason for hiding this comment

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

You should check the error on this.

err := c.GetFile(commit.Commit, "/hello", &buf)
commitFile := buf.String()
buf.Reset()
if err != nil || commitFile == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd check err before accessing anything on buf. If there's an error you can't really expect anything of the output. It could be a nil pointer here

Copy link
Member

Choose a reason for hiding this comment

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

buf is always ready to use regardless of the outcome of GetFile, but it will obviously be annoying when the output says the file is empty, when in reality there was some error.

@JComins000 JComins000 merged commit ad14264 into master Mar 13, 2024
21 checks passed
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.

None yet

4 participants