mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
add timer for test
This commit is contained in:
parent
05a6e66aa0
commit
3e84915d47
@ -27,6 +27,22 @@ struct AbyssTestBase : public ::testing::Test
|
||||
llarp_crypto_init(&crypto);
|
||||
}
|
||||
|
||||
static void
|
||||
CancelIt(void* u, uint64_t orig, uint64_t left)
|
||||
{
|
||||
if(left)
|
||||
return;
|
||||
static_cast< AbyssTestBase* >(u)->Cancel();
|
||||
}
|
||||
|
||||
/// cancel test because of timeout
|
||||
void
|
||||
Cancel()
|
||||
{
|
||||
Stop();
|
||||
ASSERT_TRUE(false);
|
||||
}
|
||||
|
||||
void
|
||||
Start()
|
||||
{
|
||||
@ -44,6 +60,7 @@ struct AbyssTestBase : public ::testing::Test
|
||||
if(server->ServeAsync(loop, logic, a))
|
||||
{
|
||||
client->RunAsync(loop, a.ToString());
|
||||
llarp_logic_call_later(logic, {1000, this, &CancelIt});
|
||||
return;
|
||||
}
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
Loading…
Reference in New Issue
Block a user