Skip to content

Commit 9c2022c

Browse files
committed
fix spanner change record test
1 parent 97e0204 commit 9c2022c

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ jobs:
4343
ref: ${{ github.event.pull_request.head.ref }}
4444
repository: ${{github.event.pull_request.head.repo.full_name}}
4545
- name: cargo-deny
46-
uses: EmbarkStudios/cargo-deny-action@v1
46+
uses: EmbarkStudios/cargo-deny-action@v2
4747
with:
48+
rust-version: "1.88.0"
4849
arguments: --workspace --all-features
4950
foundation:
5051
name: foundation

spanner/src/statement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl ToKind for ::prost_types::Timestamp {
211211
fn to_kind(&self) -> Kind {
212212
// The protobuf timestamp type should be formatted in RFC3339
213213
// See here for more details: https://docs.rs/prost-types/latest/prost_types/struct.Timestamp.html
214-
let rfc3339 = format!("{}", self);
214+
let rfc3339 = format!("{self}");
215215
rfc3339.to_kind()
216216
}
217217

spanner/tests/change_stream_test.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ async fn test_read_change_stream() {
166166
// Create Change Stream
167167
let cred = google_cloud_auth::credentials::CredentialsFile::new().await.unwrap();
168168
let project = cred.project_id.unwrap();
169-
let db = format!("projects/{}/instances/test-instance/databases/local-database", project);
169+
let db = format!("projects/{project}/instances/test-instance/databases/local-database2");
170170
let admin_client = admin::client::Client::new(AdminClientConfig {
171171
environment: create_environment().await,
172172
})
173173
.await
174174
.unwrap();
175-
let _ = admin_client
175+
let result = admin_client
176176
.database()
177177
.update_database_ddl(
178178
UpdateDatabaseDdlRequest {
@@ -185,8 +185,16 @@ async fn test_read_change_stream() {
185185
None,
186186
)
187187
.await;
188-
189-
sleep(Duration::from_secs(20)).await;
188+
match result {
189+
Ok(mut res) => {
190+
let op = res.wait(None).await;
191+
match op {
192+
Ok(_) => tracing::info!("create change stream success"),
193+
Err(e) => panic!("create change stream failed: {e:?}"),
194+
}
195+
}
196+
Err(e) => panic!("create change stream failed: {e:?}"),
197+
}
190198

191199
let now = OffsetDateTime::now_utc();
192200

0 commit comments

Comments
 (0)