private async Task QueryResultFirstOnPremTest(TestServerType serverType, string query, [CallerMemberName] string testName = "") { await TestServiceDriverProvider.RunTestIterations(async (timer) => { using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile()) using (TestServiceDriverProvider testService = new TestServiceDriverProvider()) { await testService.ConnectForQuery(serverType, query, queryTempFile.FilePath, SqlTestDb.MasterDatabaseName); testService.WriteToFile(queryTempFile.FilePath, query); await testService.RunQueryAndWaitToStart(queryTempFile.FilePath, 50000); await testService.ExecuteWithTimeout(timer, 500000, async() => { var queryResult = await testService.ExecuteSubset(queryTempFile.FilePath, 0, 0, 0, 50); if (queryResult != null) { Assert.NotNull(queryResult); Assert.NotNull(queryResult.ResultSubset); Assert.True(queryResult.ResultSubset.Rows.Any()); } return(queryResult != null); }, TimeSpan.FromMilliseconds(10)); await testService.Disconnect(queryTempFile.FilePath); } }, testName); }