mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-05 20:42:54 +00:00
Speed up test shutdown, by polling more frequently.
A fair amount of the time in our python tests is spent waiting for the pageserver and safekeeper processes to shut down. It doesn't matter so much when you're running a lot of tests in parallel, but it's quite noticeable when running them sequentially. A big part of the slowness is that is that after sending the SIGTERM signal, we poll to see if the process is still running, and the polling happened at 1 s interval. Reduce it to 0.1 s.
This commit is contained in:
@@ -247,7 +247,7 @@ impl SafekeeperNode {
|
|||||||
// Shutting down may take a long time,
|
// Shutting down may take a long time,
|
||||||
// if safekeeper flushes a lot of data
|
// if safekeeper flushes a lot of data
|
||||||
let mut tcp_stopped = false;
|
let mut tcp_stopped = false;
|
||||||
for _ in 0..100 {
|
for i in 0..600 {
|
||||||
if !tcp_stopped {
|
if !tcp_stopped {
|
||||||
if let Err(err) = TcpStream::connect(&address) {
|
if let Err(err) = TcpStream::connect(&address) {
|
||||||
tcp_stopped = true;
|
tcp_stopped = true;
|
||||||
@@ -272,9 +272,11 @@ impl SafekeeperNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print!(".");
|
if i % 10 == 0 {
|
||||||
io::stdout().flush().unwrap();
|
print!(".");
|
||||||
thread::sleep(Duration::from_secs(1));
|
io::stdout().flush().unwrap();
|
||||||
|
}
|
||||||
|
thread::sleep(Duration::from_millis(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
bail!("Failed to stop safekeeper with pid {}", pid);
|
bail!("Failed to stop safekeeper with pid {}", pid);
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ impl PageServerNode {
|
|||||||
// Shutting down may take a long time,
|
// Shutting down may take a long time,
|
||||||
// if pageserver checkpoints a lot of data
|
// if pageserver checkpoints a lot of data
|
||||||
let mut tcp_stopped = false;
|
let mut tcp_stopped = false;
|
||||||
for _ in 0..100 {
|
for i in 0..600 {
|
||||||
if !tcp_stopped {
|
if !tcp_stopped {
|
||||||
if let Err(err) = TcpStream::connect(&address) {
|
if let Err(err) = TcpStream::connect(&address) {
|
||||||
tcp_stopped = true;
|
tcp_stopped = true;
|
||||||
@@ -344,9 +344,11 @@ impl PageServerNode {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print!(".");
|
if i % 10 == 0 {
|
||||||
io::stdout().flush().unwrap();
|
print!(".");
|
||||||
thread::sleep(Duration::from_secs(1));
|
io::stdout().flush().unwrap();
|
||||||
|
}
|
||||||
|
thread::sleep(Duration::from_millis(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
bail!("Failed to stop pageserver with pid {}", pid);
|
bail!("Failed to stop pageserver with pid {}", pid);
|
||||||
|
|||||||
Reference in New Issue
Block a user