mathpaquette / IQFeed.CSharpApiClient

IQFeed.CSharpApiClient is fastest and the most well-designed C# DTN IQFeed socket API connector available
MIT License
120 stars 43 forks source link

Stale Date Range in Generate_Test_Data() #109

Closed BunkerCoder closed 3 years ago

BunkerCoder commented 3 years ago

Generate_Test_Data() test is failing with message: IQFeed.CSharpApiClient.Common.Exceptions.NoDataIQFeedException : IQFeed doesn't have any data for the request sent. I got it working by changing startDate and endDate to more recent dates that are within the IQFeed archived history timelines.

I'm surprised nobody has noticed. Is this just something that we need to remember to do when testing?
Should we change the test to make the date range relative to today's date? I can work up the change if you'd like.

I have a simple commit with my changes (plus add *.playlist to .gitignore to allow suppressing tests that break live sessions). Let me know if you'd like a PR. Thanks

mathpaquette commented 3 years ago

@BunkerCoder this test is marked [Explicit] and should not be part of the normal run unless you manually run it. We don't check them frequently. Probably I added it to conveniently generate these csv files but nothing more to test than that.

mathpaquette commented 3 years ago

@BunkerCoder Im not aware of this session problem....

BunkerCoder commented 3 years ago

@mathpaquette - I was talking about above and in #104 was the trading session, but the problem happens any time I run tests locally when the IQFeed Connection Manager is already open and serving another client app. Some of the tests cause the Connection Manager to throw an Error dialog stating "Sorry, your Product and/or Service for the attempted login are incorrect. If you have recently changed products you may also need to change your type of service. Please contact DTN customer support for assistance. (1)" Then it terminates in 30 seconds unless terminated earlier by a test. Sometimes it blanks out my saved user ID and password from the login dialog and I have to re-enter them the next time I start one of the IQFeed apps.

I never paid attention to the Explicit attribute. When I open the Test Explorer in VS, it selects all tests, including those marked Explicit. I haven't found any setting that auto-excludes Explicits. How do YOU run local tests so that Explicit-tagged tests are excluded?

I created a playlist that excludes any Explicit tests. Running the remaining tests still crashed IQFeed Connection Manager until I also excluded IQFeed.CSharpApiClient.Tests.Integration.Streaming.Admin.AdminClientTests. I didn't check all tests, but it looks like the call to RegisterClientApp with a product ID that isn't mine is one of the culprits.

I can share the playlist, but it only solves the problem if it is explicitly loaded into Test Explorer, and I haven't seen a way to cause a playlist to auto-load with the full SLN/solution.

Let me know what you think.

mathpaquette commented 3 years ago

@BunkerCoder to be honest, maybe you need to update to latest Visual Studio and get Resharper enable or something. It does exclusion unless you manually force the test...

Which Visual Studio version you got?

BunkerCoder commented 3 years ago

@mathpaquette - I'm on VS Community 2019 v16.8.3, so I'm pretty current. It looks like Resharper is the key. I'd heard of it, but never checked into it. Looks awesome. Thanks for the heads-up. Hopefully I'm the last one to trip over this.