econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
321 stars 197 forks source link

failing pytests with EEEEE on example notebooks on master #1162

Closed sbenthall closed 1 year ago

sbenthall commented 1 year ago

Failing test on master.

https://github.com/econ-ark/HARK/runs/7728133010?check_suite_focus=true

Possibly related to:

https://github.com/nedbat/coveragepy/issues/1286

sbenthall commented 1 year ago

This is happening on this test:

https://github.com/econ-ark/HARK/blob/master/.github/workflows/examples.yml

sbenthall commented 1 year ago

Locally I'm getting EEEE errors on:

But also (the plot thickens) a failure (FFF) on:

Though this could be due to not having updated the dependencies with xarray.

alanlujan91 commented 1 year ago

Just ran this locally an everything passed.

(hark-dev) C:\Users\alujan\GitHub\alanlujan91\HARK>pytest --nbval-lax --current-env examples/
=============================================================== test session starts ===============================================================
platform win32 -- Python 3.9.13, pytest-7.1.2, pluggy-1.0.0
rootdir: C:\Users\alujan\GitHub\alanlujan91\HARK
plugins: anyio-3.6.1, nbval-0.9.6
collected 446 items

examples\ConsIndShockModel\Finite Cyclical Test.ipynb ......                                                                                 [  1%]
examples\ConsIndShockModel\IndShockConsumerType.ipynb ................                                                                       [  4%]
examples\ConsIndShockModel\KinkedRconsumerType.ipynb ..........                                                                              [  7%]
examples\ConsIndShockModel\PerfForesightConsumerType.ipynb ................                                                                  [ 10%]
examples\ConsPortfolioModel\example_ConsPortfolioModel.ipynb ......................                                                          [ 15%]
examples\ConsPortfolioModel\example_ConsRiskyAssetModel.ipynb ...........................                                                    [ 21%]
examples\ConsPortfolioModel\example_ConsSequentialPortfolioModel.ipynb ............                                                          [ 24%]
examples\ConsumptionSaving\example_ConsAggShockModel.ipynb ...........                                                                       [ 26%]
examples\ConsumptionSaving\example_ConsGenIncProcessModel.ipynb ..............                                                               [ 30%]
examples\ConsumptionSaving\example_ConsIndShock.ipynb .........................                                                              [ 35%]
examples\ConsumptionSaving\example_ConsLaborModel.ipynb ...................                                                                  [ 39%]
examples\ConsumptionSaving\example_ConsMarkovModel.ipynb ....................                                                                [ 44%]
examples\ConsumptionSaving\example_ConsMedModel.ipynb ...........                                                                            [ 46%]
examples\ConsumptionSaving\example_ConsPrefShockModel.ipynb ...............                                                                  [ 50%]
examples\ConsumptionSaving\example_ConsRepAgentModel.ipynb .......                                                                           [ 51%]
examples\ConsumptionSaving\example_TractableBufferStockModel.ipynb .............                                                             [ 54%]
examples\Distributions\DiscreteDistributionXRA.ipynb ...........                                                                             [ 57%]
examples\Distributions\ExpectedValue.ipynb .................                                                                                 [ 60%]
examples\FrameAgentType\FrameAgentType Demo.ipynb .........................                                                                  [ 66%]
examples\FrameAgentType\FrameModels.ipynb ..............................                                                                     [ 73%]
examples\GenIncProcessModel\GenIncProcessModel.ipynb ...............                                                        [ 76%] 
examples\Gentle-Intro\Gentle-Intro-To-HARK.ipynb .................                                                          [ 80%] 
examples\HowWeSolveIndShockConsumerType\HowWeSolveIndShockConsumerType.ipynb ...............                                [ 83%] 
examples\Interpolation\CubicInterp.ipynb ........                                                                           [ 85%] 
examples\Journeys\AzureMachineLearning.ipynb .......                                                                        [ 87%] 
examples\Journeys\Journey_1_PhD.ipynb .....                                                                                 [ 88%] 
examples\Journeys\Journeys_into_HARK.ipynb .                                                                                [ 88%] 
examples\Journeys\Quickstart_tutorial\Quick_start_with_solution.ipynb .........................................             [ 97%] 
examples\LifecycleModel\LifecycleModel.ipynb ..........                                                                     [100%] 

======================================================== warnings summary ======================================================== 
..\..\..\miniconda3\envs\hark-dev\lib\site-packages\_pytest\nodes.py:633: 30 warnings
  C:\Users\alujan\miniconda3\envs\hark-dev\lib\site-packages\_pytest\nodes.py:633: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)

examples/ConsIndShockModel/Finite Cyclical Test.ipynb::Cell 0
  C:\Users\alujan\miniconda3\envs\hark-dev\lib\site-packages\zmq\_future.py:679: RuntimeWarning: Proactor event loop does not implement add_reader family of methods required for zmq. Registering an additional selector thread for add_reader support via tornado. Use `asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())` to avoid this warning.
    self._get_loop()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================== 446 passed, 31 warnings in 873.13s (0:14:33) ========================================== 
alanlujan91 commented 1 year ago

Tests are now passing on master branch.

During meeting with @llorracc on Friday we found out that sometimes if your tests are failing locally, you can re-install econ-ark dev branch with pip install -e . and the tests should pass when re-run.

sbenthall commented 1 year ago

So we think that whatever was happening deeper in the stack was fixed by those communities? Or was there an update to master that fixed the issue?

alanlujan91 commented 1 year ago

Yes, I think something was fixed elsewhere. There were no changes to master.