Skip to content

Tests flaky due to dependency on network #481

@viathor

Description

@viathor

We have three tests that rely on the pubchempy module for retrieving data from the PubChem db:

  • ExamplesTest.test_can_run_examples_jupyter_notebooks,
  • OpenFermionPubChemTest.test_helium,
  • OpenFermionPubChemTest.test_water,

defined in

  • src/openfermion/tests/_examples_test.py,
  • src/openfermion/utils/_pubchem_test.py.

Since pubchempy makes outbound network connections, the tests sometimes fail for reasons unrelated to the code they are meant exercise. For example, see #480 where judging by the error code errno=99 (aka EADDRNOTAVAIL) which we got back in the URLError exception the failure appears to be due to local port number exhaustion.

Probably the best way to fix this is to use dependency injection and local datasets (retrieved from PubChem manually and stored alongside the tests).

Metadata

Metadata

Assignees

Labels

area/dependenciesInvolves packages or other software that qsim depends onarea/pythonInvolves Python codeno QC knowledge neededDoes not require knowledge of quantum computingpriority/p2Medium priority

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions