Skip to content

Commit

Permalink
chore: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Zorkaltsev committed Sep 23, 2024
1 parent c0b59ed commit 2e7f825
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
4 changes: 4 additions & 0 deletions .env.dev.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
YDB_ANONYMOUS_CREDENTIALS=1
YDB_SSL_ROOT_CERTIFICATES_FILE=../slo-tests/playground/data/ydb_certs/ca.pem
YDB_ENDPOINT=grpc://localhost:2136
YDB_LOG_LEVEL=debug
58 changes: 29 additions & 29 deletions src/__tests__/e2e/topic-service/grpc-fail.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if (process.env.TEST_ENVIRONMENT === 'dev') require('dotenv').config();
// import {google, Ydb} from "ydb-sdk-proto";
// import {sleep} from "../../../utils";
import {google, Ydb} from "ydb-sdk-proto";
import {sleep} from "../../../utils";
import {AnonymousAuthService, Driver as YDB, Logger} from "../../../index";
import {SimpleLogger} from "../../../logger/simple-logger";

Expand Down Expand Up @@ -32,35 +32,17 @@ describe('internal stream', () => {

it('forceable end', async () => {

// const stream = await ydb!.topic.createWriter({
const stream = await ydb!.topic.createWriter({
path: 'myTopic',
getLastSeqNo: true,
});

// new TopicWriteStreamWithEvents({
// path: 'myTopic',
// producerId: 'cd9e8767-f391-4f97-b4ea-75faa7b0642d',
// getLastSeqNo: true,
// });
//
// // new TopicWriteStreamWithEvents({
// // path: 'myTopic',
// // producerId: 'cd9e8767-f391-4f97-b4ea-75faa7b0642d',
// // getLastSeqNo: true,
// // }, await (ydb! as any).discoveryService.getTopicNodeClient(), logger);
//
// // stream.writeRequest({
// // codec: Ydb.Topic.Codec.CODEC_RAW,
// // messages: [{
// // data: Buffer.alloc(10, '1234567890'),
// // uncompressedSize: '1234567890'.length,
// // createdAt: google.protobuf.Timestamp.create({
// // seconds: 123,
// // nanos: 456,
// // }),
// // }],
// // });
//
// logger.info('before sleep')
//
// await sleep(30_000)
//
// logger.info('after sleep')
//
// }, await (ydb! as any).discoveryService.getTopicNodeClient(), logger);

// stream.writeRequest({
// codec: Ydb.Topic.Codec.CODEC_RAW,
// messages: [{
Expand All @@ -73,6 +55,24 @@ describe('internal stream', () => {
// }],
// });

logger.info('before sleep')

await sleep(30_000)

logger.info('after sleep')

stream.writeRequest({
codec: Ydb.Topic.Codec.CODEC_RAW,
messages: [{
data: Buffer.alloc(10, '1234567890'),
uncompressedSize: '1234567890'.length,
createdAt: google.protobuf.Timestamp.create({
seconds: 123,
nanos: 456,
}),
}],
});

// stream.close();
}, 60_000);
});

0 comments on commit 2e7f825

Please sign in to comment.