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

skip TestSnapshotCopy for GPD block storage #2045

Merged
merged 1 commit into from
May 3, 2023
Merged

Conversation

kale-amruta
Copy link
Contributor

@kale-amruta kale-amruta commented May 3, 2023

Change Overview

[2023-05-03T08:57:45.255Z] panic: runtime error: invalid memory address or nil pointer dereference [recovered]
[2023-05-03T08:57:45.255Z] 	panic: runtime error: invalid memory address or nil pointer dereference
[2023-05-03T08:57:45.255Z] [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x23fcfb9]

[2023-05-03T08:57:45.255Z] goroutine 430 [running]:
[2023-05-03T08:57:45.255Z] testing.tRunner.func1.2({0x28a2520, 0x4a38100})
[2023-05-03T08:57:45.255Z] 	/usr/local/go/src/testing/testing.go:1396 +0x24e
[2023-05-03T08:57:45.255Z] testing.tRunner.func1()
[2023-05-03T08:57:45.255Z] 	/usr/local/go/src/testing/testing.go:1399 +0x39f
[2023-05-03T08:57:45.255Z] panic({0x28a2520, 0x4a38100})
[2023-05-03T08:57:45.255Z] 	/usr/local/go/src/runtime/panic.go:884 +0x212
[2023-05-03T08:57:45.255Z] github.com/kanisterio/kanister/pkg/blockstorage_test.(*BlockStorageProviderSuite).TestSnapshotCopy(0xc000065880, 0xc00086a338)

The test TestSnapshotCopy gives nil pointer exception since *dstSnapshot is not initialized for GPD provider. Hence passing it to s.provider.SnapshotCopy would fail the test

if s.storageType != blockstorage.TypeAD {
		snap, err = s.provider.SnapshotCopy(context.TODO(), *srcSnapshot, *dstSnapshot)
		c.Assert(err, IsNil)
	}

Even if we initialize dstSnapshot as dstSnapshot = &blockstorage.Snapshot{} , the test would still fail since SnapshotCopy is not implemented for GPD provider

// SnapshotCopy is part of blockstorage.Provider
func (s *GpdStorage) SnapshotCopy(ctx context.Context, from blockstorage.Snapshot, to blockstorage.Snapshot) (*blockstorage.Snapshot, error) {
	return nil, errors.Errorf("Not implemented")
}

The test TestSnapshotCopy passes for AWS provider but fails for GPD provider.

This PR is to skip the test for GPD provider

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

Thanks for submitting this pull request 🎉. The team will review it soon and get back to you.

If you haven't already, please take a moment to review our project contributing guideline and Code of Conduct document.

@infraq infraq added this to In Progress in Kanister May 3, 2023
@leuyentran
Copy link
Contributor

@kale-amruta do we have a follow up issue to find a proper fix?

@kale-amruta
Copy link
Contributor Author

@leuyentran created it just now - #2046

Kanister automation moved this from In Progress to Reviewer approved May 3, 2023
@mergify mergify bot merged commit 11cde2d into master May 3, 2023
Kanister automation moved this from Reviewer approved to Done May 3, 2023
@mergify mergify bot deleted the fixGPDBlockStorageTest branch May 3, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants