Skip to content

Compare the replayed bars in ResetWorksAsExpected - #9700

Merged
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
mkzung:bug-9699-consolidator-reset-test
Aug 14, 2026
Merged

Compare the replayed bars in ResetWorksAsExpected#9700
Martin-Molinero merged 1 commit into
QuantConnect:masterfrom
mkzung:bug-9699-consolidator-reset-test

Conversation

@mkzung

@mkzung mkzung commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

ResetWorksAsExpected discarded a lazy Zip, so AssertConsolidatedValues never ran and only the bar counts were compared.

Related Issue

#9699

Motivation and Context

The test is the only reset coverage the 16 consolidator fixtures share. Deleting _workingBar = null; from PeriodCountConsolidatorBase.Reset() leaves a real state leak in the base class most consolidators derive from, and on master the test still passes 17 of 17. With the comparison enumerated it fails.

Three fixtures also produced no consolidated bars at all, so there was nothing to compare even once the comparison runs. OpenInterest consolidates daily and fed 11 minutes; MarketHourAware consolidates hourly and fed 11 minutes. Both now cross a period boundary. The python wrapper fixture never sets consolidated on purpose, so it declares that instead.

Requires Documentation Change

No.

How Has This Been Tested?

Putting Assert.Fail as the first line of AssertConsolidatedValues passes 17 of 17 on master, which is the bug. With this change the same planted _workingBar leak turns ResetWorksAsExpected red and reverting it turns it green.

All 17 fixtures pass with the comparison running.

Full suite, --filter "TestCategory!=TravisExclude&TestCategory!=ResearchRegressionTests": 36614 tests, 4 failures, against 3 on master. CommanCallback(Python) and ZipBytesReturnsByteArrayWithCorrectLength fail on both. The other three, ThreadSafety, DoesNotLeak and MultiThreadReadWriteTest, alternate between runs and all pass in isolation; none of them touches a consolidator.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description>

@Martin-Molinero Martin-Molinero left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @mkzung!

@Martin-Molinero
Martin-Molinero merged commit d865a40 into QuantConnect:master Aug 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants