func (e *Environment) MustReopen(tb testing.TB, openOpts ...func(*repo.Options)) {
	tb.Helper()

	ctx := testlogging.Context(tb)

	err := e.RepositoryWriter.Close(ctx)
	if err != nil {
		tb.Fatalf("close error: %v", err)
	}

	// ensure context passed to Open() is not used for cancelation signal.
	ctx2, cancel := context.WithCancel(ctx)
	defer cancel()

	rep, err := repo.Open(ctx2, e.ConfigFile(), e.Password, repoOptions(openOpts))
	if err != nil {
		tb.Fatalf("err: %v", err)
	}

	tb.Cleanup(func() { rep.Close(ctx) })

	_, e.RepositoryWriter, err = rep.(repo.DirectRepository).NewDirectWriter(ctx, repo.WriteSessionOptions{Purpose: "test"})
	if err != nil {
		tb.Fatalf("err: %v", err)
	}
}
// MustReopen closes and reopens the repository.
MustReopen closes and reopens the repository.
// MustReopen closes and reopens the repository .
func (e *Environment) MustReopen(tb testing.TB, openOpts ...func(*repo.Options)) {
	tb.Helper()
	ctx := testlogging.Context(tb)
	err := e.RepositoryWriter.Close(ctx)
	if err != nil {
		tb.Fatalf("close error: %v", err)
	}
	ctx2, cancel := context.WithCancel(ctx)
	defer cancel()
	rep, err := repo.Open(ctx2, e.ConfigFile(), e.Password, repoOptions(openOpts))
	if err != nil {
		tb.Fatalf("err: %v", err)
	}
	tb.Cleanup(func() { rep.Close(ctx) })
	_, e.RepositoryWriter, err = rep.(repo.DirectRepository).NewDirectWriter(ctx, repo.WriteSessionOptions{Purpose: "test"})
	if err != nil {
		tb.Fatalf("err: %v", err)
	}
}
func ( e * Environment ) MustReopen ( tb testing . TB , openOpts ... func ( * repo . Options ) ) { tb . Helper ( ) ctx := testlogging . Context ( tb ) err := e . RepositoryWriter . Close ( ctx ) if err != nil { tb . Fatalf ( " " , err ) } ctx2 , cancel := context . WithCancel ( ctx ) defer cancel ( ) rep , err := repo . Open ( ctx2 , e . ConfigFile ( ) , e . Password , repoOptions ( openOpts ) ) if err != nil { tb . Fatalf ( " " , err ) } tb . Cleanup ( func ( ) { rep . Close ( ctx ) } ) _ , e . RepositoryWriter , err = rep . ( repo . DirectRepository ) . NewDirectWriter ( ctx , repo . WriteSessionOptions { Purpose : " " } ) if err != nil { tb . Fatalf ( " " , err ) } }
MustReopen closes and reopens the repository.
MustReopen closes and reopens the repository .
// ensure context passed to Open() is not used for cancelation signal.