Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The stock market has a test assuming that the stock forecast (
otlkMag
) is always changed after each market cycle. However, in edge cases, that's not true.Let's check the log in these actions:
https://github.com/bitburner-official/bitburner-src/actions/runs/11485607894/job/31966084518?pr=1726
https://github.com/bitburner-official/bitburner-src/actions/runs/12229503158/job/34109372108?pr=1833
Those tests failed with "Omega Software" stock (OMGA). Init value of OMGA's otlkMag is 0.5.
In each market cycle:
bitburner-src/src/StockMarket/StockMarket.tsx
Lines 289 to 297 in bf095ea
bitburner-src/src/StockMarket/Stock.ts
Lines 174 to 196 in bf095ea
When otlkMag is 0.5, otlkMagChange is set to 1. After
cycleForecast
, otlkMag may still be 0.5.This PR adds special tests for this case.
To test this PR, you can use this test code: