Group Group Group Group Group Group Group Group Group

syncShutdownGracefully() hangs Chapter 11 Tests

Chapter 11 unit test execution hangs after tearDown executed once. Sometimes all tests are executed successfully and sometimes some of tests are left unexecuted. In either case I never see “Test Succeeded”.

If I comment out the call to syncShutdownGracefully() in tearDown() then the tests execute successfully and to completion.

I’ve rebuild the Xcode project ( vapor Xcode -y) and reset the PostgreSQL DBs in Docker (both vapor and vapor-test) and get the same results.

I can run each test individually and every one succeeds.

I’m using swift-no 1.14.1

Any pointers appreciated.

Gonzalo

Hmm I think this is one of the threading issues that currently exists in Vapor - there’s a bug with the memory cache that exhibits this behaviour and I think it’s this. For now you can remove the call to syncShutdownGracefully to make it work

Thanks, will do. Really enjoying your book. I have recommended it to others.

1 Like