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

Enable synapse replication torturing #576

Merged
merged 2 commits into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/SyTest/Homeserver/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,6 @@ sub start

perspectives => { servers => {} },

# Stack traces are useful
full_twisted_stacktraces => "true",

listeners => $listeners,

# we reduce the number of bcrypt rounds to make generating users
Expand Down Expand Up @@ -229,6 +226,7 @@ sub start
map {
defined $self->{$_} ? ( $_ => $self->{$_} ) : ()
} qw(
replication_torture_level
cas_config
app_service_config_files
),
Expand Down Expand Up @@ -595,6 +593,12 @@ sub _init
$self->SUPER::_init( @_ );

$self->{dendron} = delete $args->{dendron_binary};
if( delete $args->{torture_replication} ) {
# torture the replication protocol a bit, to replicate bugs.
# (value is the number of ms to wait before sending out each batch of
# updates.)
$self->{replication_torture_level} = 50;
}

my $idx = $self->{hs_index};
$self->{ports}{dendron} = main::alloc_port( "dendron[$idx]" );
Expand Down
5 changes: 4 additions & 1 deletion lib/SyTest/HomeserverFactory/Synapse.pm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ sub print_usage

-ENAME, -ENAME=VALUE - pass extra argument NAME or NAME=VALUE to the
homeserver.

EOF
}

Expand Down Expand Up @@ -112,6 +111,7 @@ sub _init
$self->SUPER::_init( @_ );
$self->{impl} = "SyTest::Homeserver::Synapse::ViaDendron";
$self->{args}{dendron_binary} = "";
$self->{args}{torture_replication} = 0;
}

sub get_options
Expand All @@ -120,6 +120,7 @@ sub get_options

return (
'dendron-binary=s' => \$self->{args}{dendron_binary},
'torture-replication+' => \$self->{args}{torture_replication},
$self->SUPER::get_options(),
);
}
Expand All @@ -133,6 +134,8 @@ sub print_usage
print STDERR <<EOF;

--dendron-binary PATH - path to the 'dendron' binary

--torture-replication - enable torturing of the replication protocol
EOF
}

Expand Down