Skip to content

Commit

Permalink
Fix TestDropReadOnly (fails on Windows) (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuanwo authored and martinmr committed Jan 4, 2019
1 parent 09d0664 commit 984037c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion managed_db_test.go
Expand Up @@ -5,6 +5,7 @@ import (
"math"
"math/rand"
"os"
"runtime"
"sync"
"sync/atomic"
"testing"
Expand Down Expand Up @@ -157,7 +158,12 @@ func TestDropReadOnly(t *testing.T) {

opts.ReadOnly = true
db2, err := Open(opts)
require.NoError(t, err)
// acquireDirectoryLock returns ErrWindowsNotSupported on Windows. It can be ignored safely.
if runtime.GOOS == "windows" {
require.Equal(t, err, ErrWindowsNotSupported)
} else {
require.NoError(t, err)
}
require.Panics(t, func() { db2.DropAll() })
}

Expand Down

0 comments on commit 984037c

Please sign in to comment.