summaryrefslogtreecommitdiff
path: root/test/gdbm
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-19 08:15:16 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-19 08:15:16 +0000
commit332938df510b510589561b41249e1eb34954c259 (patch)
tree6b569182ad54e824508fe9d0c271b221328ca4d9 /test/gdbm
parentd11ce2be2ed285d6959977d5d7ee2f0f110141d1 (diff)
merge revision(s) 61501,61758: [Backport #14481]
fix concurrent test. * test/rubygems/test_require.rb (test_concurrent_require): Synchronizations should be in ensure clause. Sometimes `require` fails (not sure why) and latch is not released. Such case introduces unlimited awaiting. This patch soleve this problem. skip some tests so that no failure occurs in root privilege Some tests had failed on `sudo make test-all`, mainly because root can access any files regardless of permission. This change adds `skip` guards into such tests. Note that almost all tests in which `skip` guards is added, already have "windows" guard. This is because there is no support to avoid read access by owner on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@62834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/gdbm')
-rw-r--r--test/gdbm/test_gdbm.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/gdbm/test_gdbm.rb b/test/gdbm/test_gdbm.rb
index 1d69634f88..9e97eb3587 100644
--- a/test/gdbm/test_gdbm.rb
+++ b/test/gdbm/test_gdbm.rb
@@ -43,6 +43,8 @@ if defined? GDBM
end
def test_delete_rdonly
+ skip("skipped because root can open anything") if Process.uid == 0
+
if /^CYGWIN_9/ !~ SYSTEM
assert_raise(GDBMError) {
@gdbm_rdonly.delete("foo")
@@ -211,6 +213,8 @@ if defined? GDBM
end if defined? GDBM::NOLOCK # gdbm 1.8.0 specific
def test_s_open_error
+ skip if Process.uid == 0 # because root can open anything
+
assert_instance_of(GDBM, gdbm = GDBM.open("#{@tmpdir}/#{@prefix}", 0))
assert_raise(Errno::EACCES, Errno::EWOULDBLOCK) {
GDBM.open("#{@tmpdir}/#{@prefix}", 0)