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

Overwrite allowed on Travis with open connection #5

Closed
bjcairns opened this issue Jul 12, 2019 · 2 comments
Closed

Overwrite allowed on Travis with open connection #5

bjcairns opened this issue Jul 12, 2019 · 2 comments
Assignees
Labels
minor bug Something minor isn't working

Comments

@bjcairns
Copy link
Owner

On Travis-CI, build 6 failed because the test suite failed with the following report:

  ── 1. Failure: create_schema_db() fails to overwrite when db is connected (@test
  `{ ... }` did not throw an error.
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 19 SKIPPED: 1 WARNINGS: 1 FAILED: 1
  1. Failure: create_schema_db() fails to overwrite when db is connected (@test-create-schema-db.R#73) 

The failing test passes on my local Win10 OS, so maybe this is an OS issue?

The current work-around is to skip the test except on Windows, but it would be nice to know whether this goes deeper, e.g. if on Linux systems file.remove() works even when there is an open database connection. If so, some more robust way to check for open connections would be nice to have.

@bjcairns bjcairns added the bug Something isn't working label Jul 12, 2019
@bjcairns bjcairns self-assigned this Jul 12, 2019
@bjcairns bjcairns added minor bug Something minor isn't working and removed bug Something isn't working labels Jul 17, 2019
@elreda
Copy link

elreda commented Sep 1, 2019

It seems to be an OS thing indeed. On MacOS for example, file.remove() has no problem deleting a file with an open database connection.

Based on the answer below on SO, running lsof on the file could be one way to "manually" check for open connections on Unix systems before trying to remove the file.
https://stackoverflow.com/questions/12138260

bjcairns added a commit that referenced this issue Oct 9, 2019
Check open connections in unix before deleting. Candidate for #5
@bjcairns
Copy link
Owner Author

bjcairns commented Feb 6, 2021

Going to close this - planning to migrate to GitHub Actions (per #34) and will see where that leaves us.

@bjcairns bjcairns closed this as completed Feb 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor bug Something minor isn't working
Projects
None yet
Development

No branches or pull requests

2 participants