• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aiidateam / aiida_core / 6646
74%
develop: 74%

Build:
Build:
LAST BUILD BRANCH: fix_3032_doc_working_importexport
DEFAULT BRANCH: develop
Ran 04 Jul 2019 12:17PM UTC
Jobs 4
Files 403
Run time 7min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
6646

Pull #3121

travis-ci

web-flow
Short circuit execution of calculation functions when caching

The caching of `CalcFunctionNodes` was working properly, however, the
process would still be executed afterwards. Somewhat surprisingly this
did not seem to cause obvious side effects or exceptions elsewhere. The
symptom that brought this to light is the fact that the result node that
was returned was unstored, despite the actual outputs being stored and
recorded properly. The origin of the problem is that the caching takes
place in the `Node.store` method, which is called indirectly by the
`Process.on_entered` when the process is created. However, in the case
that the node is created from a cached node, the `Process` is not
informed and merrily continues on its way calling `run`.

This problem was already addressed in the `CalcJob` class, where in the
`run` method the node was checked whether it already had an exit status
attribute. This would mean the node was cached from an already finished
calculation and so the method returns immediately. Note that this works,
because for a `ProcessNode` to be even considered a valid cache node, it
has to be `finished_ok` meaning it always has an `exit_status` attribute.
See the `ProcessNode.is_valid_cache` property.

To fix the problem for calculation functions, we simply add the same
check. Note that we cannot easily abstract this to the parent `Process`
class and have the sub classes call the super first, because they will
then have to check the result of the super call and return the value if
it is not `None`, which is not necessarily a cleaner solution then the
code duplication solution chosen here.

Another thing to keep in mind is that this is now only done for the
`FunctionProcess` and `CalcJob` process classes so the check is not
applied for the `WorkChain`. However, for now this is not problematic
since `WorkChainNodes` are not cachable anyway.
Pull Request #3121: Short circuit execution of calculation functions when caching

2 of 2 new or added lines in 1 file covered. (100.0%)

23949 of 32210 relevant lines covered (74.35%)

2.75 hits per line

Jobs
ID Job ID Ran Files Coverage
5 6646.5 (TEST_AIIDA_BACKEND=django TEST_TYPE="tests") 04 Jul 2019 12:17PM UTC 0
68.07
Travis Job 6646.5
6 6646.6 (TEST_AIIDA_BACKEND=django TEST_TYPE="tests") 04 Jul 2019 12:22PM UTC 0
68.03
Travis Job 6646.6
7 6646.7 (TEST_AIIDA_BACKEND=sqlalchemy TEST_TYPE="tests") 04 Jul 2019 12:23PM UTC 0
69.65
Travis Job 6646.7
8 6646.8 (TEST_AIIDA_BACKEND=sqlalchemy TEST_TYPE="tests") 04 Jul 2019 12:24PM UTC 0
69.59
Travis Job 6646.8
Source Files on build 6646
  • List 0
  • Changed 32
  • Source Changed 3
  • Coverage Changed 32
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Travis Build #6646
  • Pull Request #3121
  • PR Base - develop (#6644)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc