MCPcopy Index your code
hub / github.com/golang-migrate/migrate / testLockWorks

Function testLockWorks

database/sqlserver/sqlserver_test.go:226–263  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

224}
225
226func testLockWorks(t *testing.T) {
227 dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) {
228 SkipIfUnsupportedArch(t, c)
229 ip, port, err := c.Port(defaultPort)
230 if err != nil {
231 t.Fatal(err)
232 }
233
234 addr := fmt.Sprintf("sqlserver://sa:%v@%v:%v?master", saPassword, ip, port)
235 p := &SQLServer{}
236 d, err := p.Open(addr)
237 if err != nil {
238 t.Fatalf("%v", err)
239 }
240 dt.Test(t, d, []byte("SELECT 1"))
241
242 ms := d.(*SQLServer)
243
244 err = ms.Lock()
245 if err != nil {
246 t.Fatal(err)
247 }
248 err = ms.Unlock()
249 if err != nil {
250 t.Fatal(err)
251 }
252
253 // make sure the 2nd lock works (RELEASE_LOCK is very finicky)
254 err = ms.Lock()
255 if err != nil {
256 t.Fatal(err)
257 }
258 err = ms.Unlock()
259 if err != nil {
260 t.Fatal(err)
261 }
262 })
263}
264
265func testMsiTrue(t *testing.T) {
266 dktesting.ParallelTest(t, specs, func(t *testing.T, c dktest.ContainerInfo) {

Callers

nothing calls this directly

Calls 6

OpenMethod · 0.95
ParallelTestFunction · 0.92
SkipIfUnsupportedArchFunction · 0.85
PortMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…