Skip to content

Commit

Permalink
Rust tests and py binding updated
Browse files Browse the repository at this point in the history
  • Loading branch information
spirali committed Nov 16, 2024
1 parent d026836 commit eee6e85
Show file tree
Hide file tree
Showing 15 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/client/commands/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,4 @@ pub async fn forget_job(
log::info!("{message}");

Ok(())
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/client/commands/journal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ async fn flush_journal(gsettings: &GlobalSettings) -> anyhow::Result<()> {
)
.await?;
Ok(())
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/client/commands/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@ fn command_server_generate_access(
store_access_record(&worker_record, path)?;
}
Ok(())
}
}
4 changes: 3 additions & 1 deletion crates/hyperqueue/src/server/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ mod tests {
use std::future::Future;
use std::path::Path;
use std::sync::Arc;
use std::time::Duration;
use tempfile::TempDir;

pub async fn init_test_server(
Expand All @@ -419,6 +420,7 @@ mod tests {
client_port: None,
worker_port: None,
journal_path: None,
journal_flush_period: Duration::from_secs(30),
worker_secret_key: None,
client_secret_key: None,
server_uid: None,
Expand Down Expand Up @@ -506,4 +508,4 @@ mod tests {
notify.notify_one();
fut.await.unwrap();
}
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,4 +574,4 @@ async fn handle_worker_info(state_ref: &StateRef, worker_id: WorkerId) -> ToClie
let state = state_ref.get();

ToClientMessage::WorkerInfoResponse(state.get_worker(worker_id).map(|w| w.make_info()))
}
}
4 changes: 2 additions & 2 deletions crates/hyperqueue/src/server/event/journal/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
mod prune;
mod read;
mod stream;
mod prune;
mod write;

pub use read::JournalReader;
pub use stream::{start_event_streaming, EventStreamMessage, EventStreamSender};
pub use write::JournalWriter;

const HQ_JOURNAL_HEADER: &[u8] = b"hqjl0001";
const HQ_JOURNAL_HEADER: &[u8] = b"hqjl0001";
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/journal/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ pub(crate) fn prune_journal(
}
}
Ok(())
}
}
4 changes: 2 additions & 2 deletions crates/hyperqueue/src/server/event/journal/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl Iterator for &mut JournalReader {

#[cfg(test)]
mod tests {
use crate::server::event::log::{JournalReader, JournalWriter};
use crate::server::event::journal::{JournalReader, JournalWriter};
use crate::server::event::payload::EventPayload;
use crate::server::event::Event;
use chrono::Utc;
Expand Down Expand Up @@ -237,4 +237,4 @@ mod tests {
EventPayload::AllocationFinished(0, _)
));
}
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/journal/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@ async fn streaming_process(
);

Ok(())
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/journal/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ impl JournalWriter {
self.file.flush()?;
Ok(())
}
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ pub struct Event {
#[serde(with = "ts_milliseconds")]
pub time: DateTime<Utc>,
pub payload: EventPayload,
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/event/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ impl EventStreamer {
None
}
}
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/server/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,4 @@ impl StateRestorer {
}
Ok(())
}
}
}
2 changes: 1 addition & 1 deletion crates/hyperqueue/src/transfer/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,4 +482,4 @@ pub struct WaitForJobsResponse {
pub failed: u32,
pub canceled: u32,
pub invalid: u32,
}
}
2 changes: 2 additions & 0 deletions crates/pyhq/src/cluster/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use hyperqueue::server::bootstrap::{initialize_server, ServerConfig};
use std::path::PathBuf;
use std::sync::Arc;
use std::thread::JoinHandle;
use std::time::Duration;
use tokio::sync::Notify;
use tokio::task::LocalSet;

Expand Down Expand Up @@ -38,6 +39,7 @@ impl RunningServer {
client_secret_key: None,
worker_secret_key: None,
server_uid: None,
journal_flush_period: Duration::from_secs(30),
};

let main_future = async move {
Expand Down

0 comments on commit eee6e85

Please sign in to comment.