This is a migrated thread and some comments may be shown as answers.

Issues when running functional tests

1 Answer 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 11 Dec 2019, 11:49 AM

We have a series of functional tests which test that our endpoints are returning a 200 status code and return a file with a content type of application/pdf.

When running the tests individualy the all pass however when clicking "run all tests" we find that tests fail at random. So sometimes 2/10 will pass other times 9/10 etc.

A null reference exception is returned with the addition of "CancelProcessingException: An error occurred while evaluating the report parameters. Report source cannot be processed. Check the InnerException for more information." unfrtunatley the inner exception is also null.

 

An example of one of our functional tests is as below:

        [Fact]
        public async Task Post_valid_data_returns_success_and_correct_content_type()
        {
            // Given
            var client = _factory.CreateClient();

            // When
            var response = await client.PostAsJsonAsync(BASE_URL,
               new ReportDataExample().GetExample());

            // Then
            await response.EnsureSuccessStatusCode();
            response.Content.Headers.ContentType.ToString().Should().Be("application/pdf");

        }

I have attached a copy of the full error including stack trace. If anyone could advise on what the issue may be and/or a possible solution it would be greatly appreciated.

 

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 16 Dec 2019, 10:46 AM

Hello Ryan,

Based on the description, I suspect that this is a bug that is already logged in our system- Occasional NullReferenceException on rendering. Feel free to vote for it. In the post, you can also find a workaround.

Regards,
Neli
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Ryan
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or