Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cse138-assignment-4-test-suite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evan Kelly Jones
cse138-assignment-4-test-suite
Commits
afd69e94
Commit
afd69e94
authored
1 month ago
by
zphrs
Browse files
Options
Downloads
Patches
Plain Diff
fixed basic_proxy_partitioned_shards; added more logging for rebroadcast
parent
f4b70e46
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/helper.py
+2
-1
2 additions, 1 deletion
tests/helper.py
tests/proxy/basic_proxy.py
+1
-1
1 addition, 1 deletion
tests/proxy/basic_proxy.py
utils/kvs_api.py
+3
-1
3 additions, 1 deletion
utils/kvs_api.py
with
6 additions
and
3 deletions
tests/helper.py
+
2
−
1
View file @
afd69e94
...
...
@@ -51,7 +51,8 @@ class KVSTestFixture:
def
rebroadcast_view
(
self
,
new_view
:
Dict
[
str
,
List
[
Dict
[
str
,
Any
]]]):
for
i
,
client
in
enumerate
(
self
.
clients
):
r
=
client
.
resend_last_view_with_ips_from_new_view
(
new_view
)
self
.
log
(
"
rebroadcasting view for node {i}
"
)
r
=
client
.
resend_last_view_with_ips_from_new_view
(
new_view
,
self
.
log
)
if
r
is
None
:
return
assert
r
.
status_code
==
200
,
(
...
...
This diff is collapsed.
Click to expand it.
tests/proxy/basic_proxy.py
+
1
−
1
View file @
afd69e94
...
...
@@ -76,8 +76,8 @@ def basic_proxy_partitioned_shards(
c
=
KVSMultiClient
(
fx
.
clients
,
"
client
"
,
log
)
conductor
.
add_shard
(
"
shard1
"
,
conductor
.
get_nodes
([
0
,
1
]))
conductor
.
add_shard
(
"
shard2
"
,
conductor
.
get_nodes
([
2
,
3
]))
conductor
.
create_partition
([
2
,
3
],
"
secondshard
"
)
fx
.
broadcast_view
(
conductor
.
get_shard_view
())
conductor
.
create_partition
([
2
,
3
],
"
secondshard
"
)
helper
(
c
,
timeout
=
timeout
)
return
True
,
"
ok
"
...
...
This diff is collapsed.
Click to expand it.
utils/kvs_api.py
+
3
−
1
View file @
afd69e94
from
logging
import
Logger
import
requests
from
typing
import
Dict
,
Any
,
List
import
aiohttp
...
...
@@ -155,6 +156,7 @@ class KVSClient:
def
resend_last_view_with_ips_from_new_view
(
self
,
current_view
:
dict
[
str
,
List
[
Dict
[
str
,
Any
]]],
log
:
Logger
,
timeout
:
float
=
DEFAULT_TIMEOUT
,
)
->
requests
.
Response
:
if
not
isinstance
(
current_view
,
dict
):
...
...
@@ -172,5 +174,5 @@ class KVSClient:
node
[
"
address
"
]
=
flattened_current_view
[
node
[
"
id
"
]]
request_body
=
{
"
view
"
:
self
.
last_view
}
print
(
f
"
Sending new view:
{
self
.
last_view
}
"
)
log
(
f
"
Sending new view:
{
self
.
last_view
}
"
)
return
requests
.
put
(
f
"
{
self
.
base_url
}
/view
"
,
json
=
request_body
,
timeout
=
timeout
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment