Level / rocksdb

Pure C++ Node.js RocksDB binding. An abstract-leveldown compliant store.
MIT License
229 stars 53 forks source link

Some unit tests fail for root user #209

Open ekulno opened 2 years ago

ekulno commented 2 years ago

Problem

4 unit tests fail when running as the root user on Ubuntu 20.04. This may be acceptable, but it may be helpful to document this.

Excerpt of the unit test logs:

// ...
⨯ test throw error reading read-only database
  not ok 1541 should get error reading read only database
  // ...
  not ok 1542 should get io error
  // ...
✓ test read from a read-only database if readOnly is true
⨯ test throw error reading read-only database if readOnly is false
  not ok 1546 should get error reading read only database
  // ...
  not ok 1547 should get io error
  // ...
# tests 1637
# pass  1633
⨯ fail  4

Impact

I am not sure whether the failing unit tests indicate that this library is not supported for the root user, or whether it is only an issue with the unit tests.

Dockerfiles use the root user by default. As a consequence, third parties who build and test this library through a Dockerfile such as myself may encounter the failing tests and be confused.

Reproduction steps

The following will succeed if running as a regular user, but four tests will fail if running as the root user (sudo su)

cd /tmp
git clone --recurse-submodules https://github.com/Level/rocksdb.git
cd rocksdb
yarn
yarn test