purge instances after each unit test to better detect hangs

This commit is contained in:
Sebastian Burckhardt 2020-12-11 07:55:43 -08:00
Родитель d350138490
Коммит 23be090c00
2 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -32,11 +32,21 @@ namespace DurableTask.Netherite.Tests
this.fixture.SetOutput(outputHelper);
// purge all instances prior to each test
this.host.PurgeAllAsync().Wait();
if (! this.host.PurgeAllAsync().Wait(TimeSpan.FromMinutes(3)))
{
throw new TimeoutException("timed out while purging instances before starting test");
}
}
public void Dispose()
{
// purge all instances after each test
// this helps to catch "bad states" (e.g. hung workers) caused by the tests
if (!this.host.PurgeAllAsync().Wait(TimeSpan.FromMinutes(3)))
{
throw new TimeoutException("timed out while purging instances after running test");
}
this.fixture.ClearOutput();
}

Просмотреть файл

@ -37,6 +37,13 @@ namespace DurableTask.Netherite.Tests
public void Dispose()
{
// purge all instances after each test
// this helps to catch "bad states" (e.g. hung workers) caused by the tests
if (!this.host.PurgeAllAsync().Wait(TimeSpan.FromMinutes(3)))
{
throw new TimeoutException("timed out while purging instances after running test");
}
this.fixture.ClearOutput();
}