Consistency of results ?

Jun 13, 2009 at 11:00 AM

Early days with unit testing and I'm already struggling ...

Put together a simple test which has a Setup that truncates a target table, then an Assert that after the SSIS task has been run, the expected count of records is in the target table

The setup is a ProcessCommand that runs SQL script via HiddenStart + batch file ...

- I know I could use a SqlCommand, but I wanted to keep the SQL seperate

- mainly so I can work with it in SSMS as I've got Red Gate's SQL Prompt, and I'm addicted to intellisense   :-)


So run the test, first time, get a fail as the count isn't right, but check the table in SSMS and the count is right ?

Then re-run any number of times, and the count is right, both in SSISUnit and SSMS

Swop to another test, back to original test, it fails again, but the data is in the target table !!


Appreciate there is probably "something" that I'm not re-setting correctly, but this is such a simple test ... SELECT COUNT(1) FROM TARGETTABLE

And I can run the test, switch to SSMS and see the record is there, so I'm stumped as to quite what is going on ???

Jun 13, 2009 at 4:25 PM

My bad ...

Originally I was using CMD.EXE to run the batch file

Then I switched to HiddenStart with the /NOCONSOLE option to avoid the flickering as of the command windows opened / closed

But I think HiddenStart was returning asynchronously, so had to add the /WAIT option to get it to run synchronously

Now things are fine ...

Jun 17, 2009 at 12:36 AM

Good to hear it's working - the command returning asynchronously would cause that behavior.