1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

[sinttest] Introduce dirty hack in performActionAndWaitForPresence()

This commit is contained in:
Florian Schmaus 2021-12-13 21:03:40 +01:00
parent 4e2d0035ac
commit def7c91e6a

View file

@ -1,6 +1,6 @@
/** /**
* *
* Copyright 2015-2020 Florian Schmaus * Copyright 2015-2021 Florian Schmaus
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with 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. * @param action the action to perform.
* @throws Exception in case of an exception. * @throws Exception in case of an exception.
*/ */
@SuppressWarnings("ThreadPriorityCheck")
protected void performActionAndWaitForPresence(XMPPConnection conA, XMPPConnection conB, ThrowingRunnable action) protected void performActionAndWaitForPresence(XMPPConnection conA, XMPPConnection conB, ThrowingRunnable action)
throws Exception { throws Exception {
final SimpleResultSyncPoint presenceReceivedSyncPoint = new SimpleResultSyncPoint(); final SimpleResultSyncPoint presenceReceivedSyncPoint = new SimpleResultSyncPoint();
@ -109,5 +110,8 @@ public abstract class AbstractSmackIntegrationTest extends AbstractSmackIntTest
} finally { } finally {
conA.removeAsyncStanzaListener(presenceListener); conA.removeAsyncStanzaListener(presenceListener);
} }
// TODO: Ugly hack to make tests using this method more reliable. Ideally no test would use this method.
Thread.yield();
} }
} }