Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax Errors in queries using ADOMD throw a timeout error after 0 seconds message #416

Closed
dgosbell opened this issue Oct 25, 2018 · 2 comments

Comments

@dgosbell
Copy link

I ran a test that had a syntax error in it against an SSAS tabular model and got the following error saying that there had been a timeout:

1) Test Error : NBi.NUnit.Runtime.TestSuite.Compare Key Metrics 
   System.AggregateException : One or more errors occurred.
  ----> NBi.Core.CommandTimeoutException : The query '
          EVALUATE
          SUMMARIZECOLUMNS (
          FILTER('Date', 'Date'[CalendarMthKey] in {201803}),
          "Test Measure", [Test Measure],
          )
        ' with the connection string 'Provider=MSOLAP;Data Source=devserver\mssqlinst01;Initial Catalog=TabularModel;' wasn't finished after 0 second and has thrown a timeout.
   at System.Threading.Tasks.Task.FastWaitAll(Task[] tasks)
   at System.Threading.Tasks.Parallel.Invoke(ParallelOptions parallelOptions, Action[] actions)
   at NBi.NUnit.ResultSetComparison.BaseResultSetComparisonConstraint.ProcessParallel(IResultSetService actual)
   at NBi.NUnit.ResultSetComparison.BaseResultSetComparisonConstraint.Process(IResultSetService actual)
   at NBi.NUnit.ResultSetComparison.BaseResultSetComparisonConstraint.Matches(Object actual)
   at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
   at NBi.NUnit.Runtime.TestSuite.AssertTestCase(Object systemUnderTest, Constraint constraint, String stackTrace)
   at NBi.NUnit.Runtime.TestSuite.ExecuteTestCases(TestXml test)
--CommandTimeoutException
   at NBi.Core.Query.Execution.DbCommandExecutionEngine.<>c.<.ctor>b__10_0(Exception ex, IDbCommand command)
   at NBi.Core.Query.Execution.AdomdExecutionEngine.HandleException(Exception ex, IDbCommand command)
   at NBi.Core.Query.Execution.DbCommandExecutionEngine.OnExecuteDataSet(IDbCommand command)
   at NBi.Core.Query.Execution.DbCommandExecutionEngine.Execute()
   at NBi.Core.ResultSet.Resolver.QueryResultSetResolver.Load(IQuery query)
   at NBi.Core.ResultSet.Resolver.QueryResultSetResolver.Execute()
   at NBi.Core.ResultSet.ResultSetService.Execute()
   at NBi.NUnit.ResultSetComparison.BaseResultSetComparisonConstraint.<>c__DisplayClass21_0.<ProcessParallel>b__0()
   at System.Threading.Tasks.Task.Execute()

The issue appears to be related to the following lines of code which calls the OnTimeout() method if the message does not start with "Timeout expired."

if (ex is AdomdErrorResponseException && !ex.Message.StartsWith("Timeout expired."))
OnTimeout(ex, command);

I think removing the ! on line 42 might fix this issue and allow the correct exception to flow through to the test.

@Seddryck
Copy link
Owner

Seddryck commented Oct 25, 2018

Thx for the report and analysis. Feel free to submit PR next time :-).

Base on your feedback , I fixed the code and a new version is available at https://ci.appveyor.com/project/Seddryck/nbi/builds/19802845 or with nuget and version 1.19.0-beta0082

@Seddryck Seddryck added the bug label Oct 25, 2018
@Seddryck Seddryck added this to the v1.19 milestone Oct 25, 2018
@dgosbell
Copy link
Author

Thanks, I will definitely submit a PR next time. I'm just starting out with NBi and was not sure 100% sure if I was on the right track so I thought I would start with an issue before lodging a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants