Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
cde8cdd8
Kaydet (Commit)
cde8cdd8
authored
Tem 29, 2008
tarafından
Jesus Cea
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Be less strict with replication timeouts (the machine
can be a bit loaded), and be sure to yield the CPU when waiting.
üst
a99363f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
test_replication.py
Lib/bsddb/test/test_replication.py
+19
-7
No files found.
Lib/bsddb/test/test_replication.py
Dosyayı görüntüle @
cde8cdd8
...
@@ -128,10 +128,10 @@ class DBReplicationManager(unittest.TestCase):
...
@@ -128,10 +128,10 @@ class DBReplicationManager(unittest.TestCase):
# is not generated if the master has no new transactions.
# is not generated if the master has no new transactions.
# This is solved in BDB 4.6 (#15542).
# This is solved in BDB 4.6 (#15542).
import
time
import
time
timeout
=
time
.
time
()
+
2
timeout
=
time
.
time
()
+
10
while
(
time
.
time
()
<
timeout
)
and
not
(
self
.
confirmed_master
and
self
.
client_startupdone
)
:
while
(
time
.
time
()
<
timeout
)
and
not
(
self
.
confirmed_master
and
self
.
client_startupdone
)
:
time
.
sleep
(
0.02
)
time
.
sleep
(
0.02
)
self
.
assertTrue
(
time
.
time
()
<
timeout
,
msg
=
"Timeout Error: "
+
str
(
time
.
time
()
-
timeout
)
)
self
.
assertTrue
(
time
.
time
()
<
timeout
)
d
=
self
.
dbenvMaster
.
repmgr_site_list
()
d
=
self
.
dbenvMaster
.
repmgr_site_list
()
self
.
assertEquals
(
len
(
d
),
1
)
self
.
assertEquals
(
len
(
d
),
1
)
...
@@ -181,22 +181,28 @@ class DBReplicationManager(unittest.TestCase):
...
@@ -181,22 +181,28 @@ class DBReplicationManager(unittest.TestCase):
self
.
dbMaster
.
put
(
"ABC"
,
"123"
,
txn
=
txn
)
self
.
dbMaster
.
put
(
"ABC"
,
"123"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
import
time
import
time
timeout
=
time
.
time
()
+
1
timeout
=
time
.
time
()
+
1
0
v
=
None
v
=
None
while
(
time
.
time
()
<
timeout
)
and
(
v
==
None
)
:
while
(
time
.
time
()
<
timeout
)
and
(
v
==
None
)
:
txn
=
self
.
dbenvClient
.
txn_begin
()
txn
=
self
.
dbenvClient
.
txn_begin
()
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
if
v
==
None
:
time
.
sleep
(
0.02
)
self
.
assertTrue
(
time
.
time
()
<
timeout
)
self
.
assertEquals
(
"123"
,
v
)
self
.
assertEquals
(
"123"
,
v
)
txn
=
self
.
dbenvMaster
.
txn_begin
()
txn
=
self
.
dbenvMaster
.
txn_begin
()
self
.
dbMaster
.
delete
(
"ABC"
,
txn
=
txn
)
self
.
dbMaster
.
delete
(
"ABC"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
timeout
=
time
.
time
()
+
1
timeout
=
time
.
time
()
+
1
0
while
(
time
.
time
()
<
timeout
)
and
(
v
!=
None
)
:
while
(
time
.
time
()
<
timeout
)
and
(
v
!=
None
)
:
txn
=
self
.
dbenvClient
.
txn_begin
()
txn
=
self
.
dbenvClient
.
txn_begin
()
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
if
v
==
None
:
time
.
sleep
(
0.02
)
self
.
assertTrue
(
time
.
time
()
<
timeout
)
self
.
assertEquals
(
None
,
v
)
self
.
assertEquals
(
None
,
v
)
class
DBBaseReplication
(
DBReplicationManager
):
class
DBBaseReplication
(
DBReplicationManager
):
...
@@ -297,7 +303,7 @@ class DBBaseReplication(DBReplicationManager):
...
@@ -297,7 +303,7 @@ class DBBaseReplication(DBReplicationManager):
# is not generated if the master has no new transactions.
# is not generated if the master has no new transactions.
# This is solved in BDB 4.6 (#15542).
# This is solved in BDB 4.6 (#15542).
import
time
import
time
timeout
=
time
.
time
()
+
2
timeout
=
time
.
time
()
+
10
while
(
time
.
time
()
<
timeout
)
and
not
(
self
.
confirmed_master
and
while
(
time
.
time
()
<
timeout
)
and
not
(
self
.
confirmed_master
and
self
.
client_startupdone
)
:
self
.
client_startupdone
)
:
time
.
sleep
(
0.02
)
time
.
sleep
(
0.02
)
...
@@ -333,22 +339,28 @@ class DBBaseReplication(DBReplicationManager):
...
@@ -333,22 +339,28 @@ class DBBaseReplication(DBReplicationManager):
self
.
dbMaster
.
put
(
"ABC"
,
"123"
,
txn
=
txn
)
self
.
dbMaster
.
put
(
"ABC"
,
"123"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
import
time
import
time
timeout
=
time
.
time
()
+
1
timeout
=
time
.
time
()
+
1
0
v
=
None
v
=
None
while
(
time
.
time
()
<
timeout
)
and
(
v
==
None
)
:
while
(
time
.
time
()
<
timeout
)
and
(
v
==
None
)
:
txn
=
self
.
dbenvClient
.
txn_begin
()
txn
=
self
.
dbenvClient
.
txn_begin
()
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
if
v
==
None
:
time
.
sleep
(
0.02
)
self
.
assertTrue
(
time
.
time
()
<
timeout
)
self
.
assertEquals
(
"123"
,
v
)
self
.
assertEquals
(
"123"
,
v
)
txn
=
self
.
dbenvMaster
.
txn_begin
()
txn
=
self
.
dbenvMaster
.
txn_begin
()
self
.
dbMaster
.
delete
(
"ABC"
,
txn
=
txn
)
self
.
dbMaster
.
delete
(
"ABC"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
timeout
=
time
.
time
()
+
1
timeout
=
time
.
time
()
+
1
0
while
(
time
.
time
()
<
timeout
)
and
(
v
!=
None
)
:
while
(
time
.
time
()
<
timeout
)
and
(
v
!=
None
)
:
txn
=
self
.
dbenvClient
.
txn_begin
()
txn
=
self
.
dbenvClient
.
txn_begin
()
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
v
=
self
.
dbClient
.
get
(
"ABC"
,
txn
=
txn
)
txn
.
commit
()
txn
.
commit
()
if
v
==
None
:
time
.
sleep
(
0.02
)
self
.
assertTrue
(
time
.
time
()
<
timeout
)
self
.
assertEquals
(
None
,
v
)
self
.
assertEquals
(
None
,
v
)
if
db
.
version
()
>=
(
4
,
7
)
:
if
db
.
version
()
>=
(
4
,
7
)
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment