Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
PointcutLatch is not properly thread safe, and the hapi-fhir-jpaserver-subscription tests are flaky as a result #1337
Describe the bug
Some of the hapi-fhir-jpaserver-subscription tests that subclass BaseBlockingQueueSubscribableChannelDstu3Test are printing exceptions to log when running, since they don't properly assert latch countdowns, and so the PointcutLatch logs that it was counted down unexpectedly. For example, try running the SubscriptionLoaderFhirClientTest, which registers subscriptions without asserting that the subscription activation latch should be counted down.
Finally, the hapi-fhir-jpaserver-subscription tests occasionally fail on heavily loaded machines, as the test Fhir server lazily loads StructureDefinitions on first use. The tests usually trigger this load by e.g. sending an Observation to the server, which should then count down a latch. The failure occurs because the test fails if counting down the latch takes more than 10 seconds, and loading StructureDefinitions the first time sometimes takes that long.