Skip to content

getcwd fixes#1745

Merged
kaplanelad merged 2 commits intoloco-rs:masterfrom
comper-io:cwd-fixes
Mar 4, 2026
Merged

getcwd fixes#1745
kaplanelad merged 2 commits intoloco-rs:masterfrom
comper-io:cwd-fixes

Conversation

@jtwaleson
Copy link
Contributor

While running tests I noticed some failures.

sh: 0: getcwd() failed: No such file or directory

and

failures:
    bgworker::pg::tests::can_cancel_job_by_name
    bgworker::pg::tests::can_clear
    bgworker::pg::tests::can_clear_by_status
    bgworker::pg::tests::can_complete_job_with_interval
    bgworker::pg::tests::can_complete_job_without_interval
    bgworker::pg::tests::can_fail_job
    bgworker::pg::tests::can_get_jobs

Narrowed this down to two points:

  • the cargo_config tests change the CWD of the process and don't restore it
  • the postgres init code relies on CWD

This changes solves both (although one would be enough): we restore CWD and make the fixture init independent of the current working dir.

We could also run the cargo_config tests in serial mode with serial_test but I opted to not use that as it would be an extra dependency and we're not using that.

@kaplanelad kaplanelad merged commit e9598a6 into loco-rs:master Mar 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants