Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove new-year race condition from "baseline testing". #3723

Open
2 tasks
aknrdureegaesr opened this issue Jan 1, 2024 · 1 comment
Open
2 tasks

Remove new-year race condition from "baseline testing". #3723

aknrdureegaesr opened this issue Jan 1, 2024 · 1 comment

Comments

@aknrdureegaesr
Copy link
Contributor

aknrdureegaesr commented Jan 1, 2024

Requested Feature: (short description)

The baseline tests make innocent pull requests fail early each year. Kindly fix the race condition.

Related Area: (eg. tasks, compilers, configuration, templates…)

Tests.

Do you want to contribute this yourself as a pull request? (don’t worry about it if you don’t want to/can’t — someone else can take care of it)

Does this feature affect backwards compatibility? If yes, in what way?

No, it does not. This concerns only tests.

Rationale and full description: (why should it be added to Nikola?)

There is a race condition. The precise circumstances to trigger the race condition are believed to be:

  • The pull request is entered early in the year.
  • The repo maintainers have not yet adjusted the baseline test to the new year.

You can see that race condition at work in one early-2024 test run, wrongly blaming pull request #3722.

This is not super-critical, as the baseline test is not required of a pull request.

Implementation idea

Integrate a filter that automatically adjusts the year number at that precise place where the diff (wrongly) finds it.

Prospect: More stabilization. (Not necessarily part of this feature request.)

Nikola is a Python project. The test could be ported from shell to Python. subprocess.run is our friend.

It is notoriously difficult to get shell script error handling correct. The baseline test is no exception. E.g., when run from another working directory different from what was intended, the scripts/getpyver.py already fails, but the script continues undeterred as if nothing was wrong. The filtering could be done as part of a port of the script to Python.

@Kwpolska
Copy link
Member

Kwpolska commented Jan 1, 2024

There are many cases where the invariant tests will fail due to reasons outside of our control. A new year is one of them, but there are also new versions of dependencies (we don’t pin versions) — and we can’t catch that as easily. The CI build is scheduled to run every Saturday, so we would be aware of a failure within a week at most. I’ve triggered a new build of the baseline site and restarted the tests of your pull requests.

Implementation-wise, doing it in bash scripts is simple — we just run wget, nikola, and diff. We used to run the baseline testing as an integration test within pytest, but there were issues with how the site is built in that context. Could the script be improved?

I don’t think a patching system is necessary. It’s easier to just re-build the demo site. If you want to try and implement this, feel free — but if this severely complicates the baseline setup, we might decide to reject this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants