Skip to content
This repository was archived by the owner on Jun 28, 2018. It is now read-only.
This repository was archived by the owner on Jun 28, 2018. It is now read-only.

ErrLocked when using migration as lib in go test #235

@yihuaf

Description

@yihuaf

I observed issues with ErrLocked when using the migration as a lib in go test. For each test file, I run migration.New() and migration.Up() and run migration.Drop() and migration.Close() during tear down.

If I run a single test, everything seems OK. However, when I run go test ./... Test starts to fail with ErrLocked. I also sometimes observe
pq: duplicate key value violates unique constraint "pg_type_typname_nsp_index" in line 0: CREATE TABLE "schema_migrations" (version bigint not null primary key, dirty boolean not null) which looks to me multiple create schema migration is run.

I am using the v3 api and the postgres driver. I use a postgres:9.6 container to test.

Am I using at wrong and there are some assumptions I am breaking? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions