From def7c91e6abe904b6013b65d89865858ea3824da Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 13 Dec 2021 21:03:40 +0100 Subject: [PATCH] [sinttest] Introduce dirty hack in performActionAndWaitForPresence() --- .../smack/inttest/AbstractSmackIntegrationTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntegrationTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntegrationTest.java index 593d5b847..f3b083611 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/AbstractSmackIntegrationTest.java @@ -1,6 +1,6 @@ /** * - * Copyright 2015-2020 Florian Schmaus + * Copyright 2015-2021 Florian Schmaus * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -85,6 +85,7 @@ public abstract class AbstractSmackIntegrationTest extends AbstractSmackIntTest * @param action the action to perform. * @throws Exception in case of an exception. */ + @SuppressWarnings("ThreadPriorityCheck") protected void performActionAndWaitForPresence(XMPPConnection conA, XMPPConnection conB, ThrowingRunnable action) throws Exception { final SimpleResultSyncPoint presenceReceivedSyncPoint = new SimpleResultSyncPoint(); @@ -109,5 +110,8 @@ public abstract class AbstractSmackIntegrationTest extends AbstractSmackIntTest } finally { conA.removeAsyncStanzaListener(presenceListener); } + + // TODO: Ugly hack to make tests using this method more reliable. Ideally no test would use this method. + Thread.yield(); } }