Skip to content

Commit

Permalink
transaction: Add test to check that the finalizer work
Browse files Browse the repository at this point in the history
  • Loading branch information
3v1n0 committed Sep 29, 2023
1 parent 2e94536 commit c748bf4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions transaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"os"
"os/user"
"path/filepath"
"runtime"
"testing"
"time"
)

func TestPAM_001(t *testing.T) {
Expand Down Expand Up @@ -438,6 +440,19 @@ func TestEnv(t *testing.T) {
}
}

func Test_Finalizer(t *testing.T) {
func() {
_, err := StartFunc("", "", nil)
if err != nil {
t.Fatalf("start #error: %v", err)
}
}()

runtime.GC()
// sleep to switch to finalizer goroutine
time.Sleep(1 * time.Millisecond)
}

func Test_Status(t *testing.T) {
if !CheckPamHasStartConfdir() {
t.Skip("this requires PAM with Conf dir support")
Expand Down

0 comments on commit c748bf4

Please sign in to comment.