Prevent extra snapshot with --use-new-run (#2943)

* Prevent extra snapshot when using new run

* Add unit tests for initializing snapshotter

There should be no snapshot for RunV2.  Added a test for SingleSnapshot
as well to prove that the test actually works (rather than `initialized`
just not being read or set properly).
This commit is contained in:
Asher
2024-01-16 21:14:03 -08:00
committed by GitHub
parent 16ed6b2428
commit 398ebfb6da
3 changed files with 27 additions and 8 deletions
+9 -5
View File
@@ -29,15 +29,19 @@ import (
)
type fakeSnapShotter struct {
file string
tarPath string
file string
tarPath string
initialized bool
}
func (f fakeSnapShotter) Init() error { return nil }
func (f fakeSnapShotter) TakeSnapshotFS() (string, error) {
func (f *fakeSnapShotter) Init() error {
f.initialized = true
return nil
}
func (f *fakeSnapShotter) TakeSnapshotFS() (string, error) {
return f.tarPath, nil
}
func (f fakeSnapShotter) TakeSnapshot(_ []string, _, _ bool) (string, error) {
func (f *fakeSnapShotter) TakeSnapshot(_ []string, _, _ bool) (string, error) {
return f.tarPath, nil
}