This repository has been archived by the owner on Dec 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
If test contains await, then [AllureStep] failed with System.ArgumentNullException : Value cannot be null. (Parameter 'key') #28
Labels
Comments
I have this issue too. Very perplexing. |
@ProAntix @redfirefox |
Another example - #41 (comment) by @bloodgang94 [AllureNUnit]
public class AllureAsyncTest
{
[Test]
public async Task Test()
{
var testUser = await GenerateAsync();
AllureLifecycle.Instance.WrapInStep(() =>
{
Assert.AreEqual(testUser, "a");
});
}
public static async Task<string> GenerateAsync()
{
return await Task.Run(() => Generate());
}
public static string Generate()
{
Thread.Sleep(1000);
return "AAA";
}
}
|
Any updates here? |
The same issue and critical for me! Pls, solve the problem! Thanks |
1 task
please follow https://github.com/allure-framework/allure-csharp/tree/main/Allure.NUnit |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This code given exception:
[Test]
public async Task Test()
{
await Task.Delay(1000);
Hello();
}
[AllureStep]
public void Hello()
{
}
System.ArgumentNullException : Value cannot be null. (Parameter 'key')
Stack Trace:
ConcurrentDictionary
2.ThrowKeyNullException() ConcurrentDictionary
2.TryGetValue(TKey key, TValue& value)ConcurrentDictionary
2.get_Item(TKey key) AllureStorage.Get[T](String uuid) AllureStorage.AddStep(String parentUuid, String uuid, StepResult stepResult) AllureLifecycle.StartStep(String parentUuid, String uuid, StepResult stepResult) AllureLifecycle.StartStep(String uuid, StepResult result) AllureStepAspect.WrapStep(String name, MethodBase methodBase, Object[] arguments, Func
2 method)Tests.__a$_around_Hello_100663386_w_0(Object[] )
Tests.Hello()
But this code - successful:
[Test]
public async Task Test()
{
Task.Delay(1000).GetAwaiter().GetResult();
Hello();
}
The text was updated successfully, but these errors were encountered: