Skip to content

Flaky test in position_notebook.ipynb #58

@Bintousk

Description

@Bintousk

Describe the bug
Hello,
I noticed an error during the Tech lab event.
The test test_positionUpdateShortBlock in position_notebook.ipynb is not consistent with the expected behaviour.
It is expecting an exception when the input value for implementations.positionSolution.position.addPosition is negative.
This behaviour is not conform with the problem requierements and is contradicting an other test (test_positionUpdates ) that is expected a successfull result when using a negative value as input for implementations.positionSolution.position.addPosition.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'bbit-learning-labs/PortfolioManager/1-Positions/position_notebook.ipynb.'
  2. Implement solution.
  3. Run test cell few times.
    4.Error will show up after few executions because it has a dependancy with a random value.

Expected behavior
The test test_positionUpdateShortBlock in position_notebook.ipynb should be removed as negative values are supported by implementations.positionSolution.position.addPosition.

Screenshots
Bellow are the screenshots of the test being flaky.
test_positionUpdates is failling if a negative input is randomly generated.
Image
Image

Environment (please complete the following information):

  • Operating System and Version: macOS 15.3 (24D60)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions