Skip to content

Semaphore not being released properly #94

@pixelstuermer

Description

@pixelstuermer

Test Setup 1

  • DockerPostgresDatabaseProvider provider
  • No specified max_connections property (therefore default 300)
  • Single integration test executed 500 times using JUnit's @RepeatedTest annotation
  • @FlywayTest with custom migration script at method level

Expected Behavior

  • Test being executed 500 times

Actual Behavior

  • Test is only executed 149 times (about half of the 300 max_connections)

Debugging

The Semaphore of the BlockingDataSourceWrapper decreases with -1 but only sometimes increases with +1. Nevertheless 3 connections seem to be blocked from the very start.

Test Setup 2

  • Same setup as the first setup
  • But having the @FlywayTest annotation with custom migration script at class level

Expected Behavior

  • Test being executed 500 times

Actual Behavior

  • Test is properly executed 500 times

Debugging

The Semaphore of the BlockingDataSourceWrapper clearly increases and decreases with +/- 1 throughout all 500 tests. Also 3 connections seem to be blocked from the very start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions