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

fix: Fix all hanging tests, reduce flakyness of other tests #2186

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
9b24d0e
fix-start-and-stop-of-autocertifier-client
ptesavol Dec 8, 2023
411ed05
Fix all hanging tests from dht and trackerless-network packages. Incl…
ptesavol Dec 8, 2023
1e8fdf2
reduce afterEach timeout
juslesan Dec 8, 2023
f141b07
stop client e2e tests from hanging
ptesavol Dec 8, 2023
9bf96d8
Merge branch 'fix-all-dht-and-trackerless-hanging-tests' of github.co…
ptesavol Dec 8, 2023
3cc0a48
disable monkey-patch
ptesavol Dec 8, 2023
3ec09eb
bring back monkey patch
ptesavol Dec 9, 2023
cf5312c
disable all other tests in CI apart from client-e2e
ptesavol Dec 9, 2023
ffb06db
Merge branch 'fix-all-dht-and-trackerless-hanging-tests' of github.co…
ptesavol Dec 9, 2023
c9042ff
re-enable monkey-patch
ptesavol Dec 9, 2023
885b8b9
moved starting and stopping of keyserver to happen in package.json sc…
ptesavol Dec 9, 2023
1fbb480
moved starting of keyserver to package.json in broker tests
ptesavol Dec 9, 2023
b2bd56e
fix package.json scripts
ptesavol Dec 9, 2023
ac6cdb5
trying to get test-utils to deploy bin
ptesavol Dec 9, 2023
f4e44fc
trying to get the bin on workspaces to node-modules
ptesavol Dec 9, 2023
b36b3a7
improve keyserver
ptesavol Dec 9, 2023
d00e5aa
re-enable everything in validate.yml
ptesavol Dec 9, 2023
f855aa0
dispose tsyringe container
ptesavol Dec 9, 2023
2001054
clean up event listeners
ptesavol Dec 9, 2023
fe098eb
add cleanup of eventlisteners
ptesavol Dec 9, 2023
2f32508
increase waitForCondition timeout
ptesavol Dec 9, 2023
4cda584
fix websocket connect timeout bug, remove all references to localhost
ptesavol Dec 10, 2023
b76116d
make LeaksDetector output readable
ptesavol Dec 10, 2023
8afd28f
fix keyserver in cli-tools, fix missing await bug in a client e2e test
ptesavol Dec 10, 2023
7415d6f
add listeners before causing the waited event
ptesavol Dec 10, 2023
45745cf
fix publish-subscribe test, add possibility to run individual tests w…
ptesavol Dec 10, 2023
fca3ffd
make storage registry test run in sequential order
ptesavol Dec 10, 2023
2a3fcf3
fix publish-subscribe test
ptesavol Dec 10, 2023
b6e287b
fix publish-subscribe test 2
ptesavol Dec 10, 2023
4d4111f
remove a memory leak
ptesavol Dec 10, 2023
3185719
made leaksdetector sequential
ptesavol Dec 10, 2023
afcc5d4
fix made leaksdetector sequential
ptesavol Dec 10, 2023
11c0f9d
enable keyserver on client browser tests
ptesavol Dec 10, 2023
12335be
try to fix remaining memory leaks
ptesavol Dec 10, 2023
16c48b9
improve memoryleaks test
ptesavol Dec 11, 2023
cbb65df
fix build
ptesavol Dec 11, 2023
7ba8baa
double memeoryleaks test timeout
ptesavol Dec 11, 2023
5bba2b2
add client.destroy() to memoryleak tests
ptesavol Dec 11, 2023
0f6cbe2
change websocket url in broker websocket plugin test
ptesavol Dec 11, 2023
412cf5b
DestroySignal refactoring to remove possible leak
ptesavol Dec 11, 2023
a8f4e50
revert to old parallel getLeaks()
ptesavol Dec 11, 2023
8c0d17a
remove hanging promise from MemoryLeaks test unsubscribe
ptesavol Dec 12, 2023
8758cd8
Merge branch 'streamr-1.0' of github.com:streamr-dev/network-monorepo…
ptesavol Dec 12, 2023
43b7f86
merged with streamr-1.0
ptesavol Dec 12, 2023
2c716ac
Fix mqtt bridge test
ptesavol Dec 12, 2023
e068993
Merge commit '890c67ed7' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
239d9b6
Merge commit 'dcb16b9f8' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
2d05db0
Merge commit '837b1704d' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
aa33ece
Merge commit '35f0b71f4' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
27279fa
Merge commit '7ae27989d' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
58975f8
Merge commit '87f33e5b1' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
b0135c8
Merge commit '15dc866ec' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
9ad5a9b
Merge commit '6c941165d' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
19b5288
Merge commit '4e2f4f7ac' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
f16b333
Merge commit '4766c4f7e' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
25414ff
Merge commit '8f0b0711e' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
fa02755
Merge commit '8069854e3' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
24041c7
Merge commit '81c4beca9' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
ab5a2c8
Merge commit '255766786' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
7178948
Merge commit '747bfb590' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
8b30ca6
Merge commit '240416343' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
cfed328
Merge commit '4166c8f58' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
dc347e9
Merge commit '5057e4f68' into fix-all-dht-and-trackerless-hanging-tests
teogeb Dec 22, 2023
7d9b824
Merge branch 'streamr-1.0' into fix-all-dht-and-trackerless-hanging-t…
teogeb Dec 22, 2023
7030a8b
Merge branch 'streamr-1.0' into fix-all-dht-and-trackerless-hanging-t…
teogeb Dec 22, 2023
23ac374
Merge branch 'main' into fix-all-dht-and-trackerless-hanging-tests
teogeb Jan 11, 2024
e6486c0
fix merge 23ac374
teogeb Jan 12, 2024
69eef4f
Merge branch 'main' into fix-all-dht-and-trackerless-hanging-tests
teogeb Jan 17, 2024
ab9b938
revert localhost to 127.0.0.1 change (shouldn't make a difference e.g…
teogeb Jan 17, 2024
fb4cead
eslint
teogeb Jan 17, 2024
6f5d492
Merge branch 'main' into fix-all-dht-and-trackerless-hanging-tests
teogeb Feb 2, 2024
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
5 changes: 1 addition & 4 deletions packages/dht/protos/DhtRpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ service WebrtcConnectorRpc {
service ConnectionLockRpc {
rpc lockRequest (LockRequest) returns (LockResponse);
rpc unlockRequest (UnlockRequest) returns (google.protobuf.Empty);
rpc gracefulDisconnect (DisconnectNotice) returns (DisconnectNoticeResponse);
rpc gracefulDisconnect (DisconnectNotice) returns (google.protobuf.Empty);
}

service ExternalApiRpc {
Expand Down Expand Up @@ -290,9 +290,6 @@ message DisconnectNotice {
DisconnectMode disconnectMode = 1;
}

message DisconnectNoticeResponse {
}

message ExternalFindDataRequest {
bytes key = 1;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ConnectionLockRpcRemote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class ConnectionLockRpcRemote extends RpcRemote<IConnectionLockRpcClient>
const options = this.formDhtRpcOptions({
doNotConnect: true,
doNotMindStopped: true,
timeout: 2000 // TODO use config option or named constant?
timeout: 2001 // TODO use config option or named constant?
})
await this.getClient().gracefulDisconnect(request, options)
}
Expand Down
10 changes: 6 additions & 4 deletions packages/dht/src/connection/ConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { protoToString } from '../helpers/protoToString'
import {
DisconnectMode,
DisconnectNotice,
DisconnectNoticeResponse,
LockRequest,
LockResponse,
Message,
Expand Down Expand Up @@ -147,7 +146,7 @@ export class ConnectionManager extends EventEmitter<TransportEvents> implements
(req: LockRequest, context: ServerCallContext) => lockRpcLocal.lockRequest(req, context))
this.rpcCommunicator.registerRpcNotification(UnlockRequest, 'unlockRequest',
(req: UnlockRequest, context: ServerCallContext) => lockRpcLocal.unlockRequest(req, context))
this.rpcCommunicator.registerRpcMethod(DisconnectNotice, DisconnectNoticeResponse, 'gracefulDisconnect',
this.rpcCommunicator.registerRpcNotification(DisconnectNotice, 'gracefulDisconnect',
(req: DisconnectNotice, context: ServerCallContext) => lockRpcLocal.gracefulDisconnect(req, context))
}

Expand All @@ -156,7 +155,7 @@ export class ConnectionManager extends EventEmitter<TransportEvents> implements
return
}
const disconnectionCandidates = new SortedContactList<Contact>({
referenceId: getNodeIdFromPeerDescriptor(this.getLocalPeerDescriptor()),
referenceId: getNodeIdFromPeerDescriptor(this.getLocalPeerDescriptor()),
maxSize: 100000, // TODO use config option or named constant?
allowToContainReferenceId: false,
emitEvents: false
Expand Down Expand Up @@ -251,7 +250,10 @@ export class ConnectionManager extends EventEmitter<TransportEvents> implements
}

public async send(message: Message, doNotConnect = false, doNotMindStopped = false): Promise<void> {
if (this.state === ConnectionManagerState.STOPPED && !doNotMindStopped) {
if (
(this.state === ConnectionManagerState.STOPPED
|| this.state === ConnectionManagerState.STOPPING)
&& !doNotMindStopped) {
return
}
const peerDescriptor = message.targetDescriptor!
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ConnectorFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class DefaultConnectorFacade implements ConnectorFacade {
this.setLocalPeerDescriptor(localPeerDescriptor)
if (localPeerDescriptor.websocket && !this.config.tlsCertificate && this.config.websocketServerEnableTls) {
try {
await this.websocketConnector.autoCertify()
await this.websocketConnector.startAutocertifierClient()
const connectivityResponse = await this.websocketConnector.checkConnectivity(false)
const autocertifiedLocalPeerDescriptor = this.config.createLocalPeerDescriptor(connectivityResponse)
if (autocertifiedLocalPeerDescriptor.websocket !== undefined) {
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/ManagedConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export class ManagedConnection extends EventEmitter<Events> {

try {
result = await runAndRaceEvents3<OutpuBufferEvents>([() => { this.outputBuffer.push(data) }],
this.outputBufferEmitter, ['bufferSent', 'bufferSendingFailed'], 15000) // TODO use config option or named constant?
this.outputBufferEmitter, ['bufferSent', 'bufferSendingFailed'], 15002) // TODO use config option or named constant?
} catch (e) {
logger.debug(`Connection to ${getNodeIdOrUnknownFromPeerDescriptor(this.remotePeerDescriptor)} timed out`, {
peerDescriptor: this.remotePeerDescriptor,
Expand Down
3 changes: 3 additions & 0 deletions packages/dht/src/connection/simulator/SimulatorConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ export class SimulatorConnection extends Connection implements IConnection {
+ ', ' + getNodeIdFromPeerDescriptor(this.targetPeerDescriptor) + ' close()')

if (!this.stopped) {
this.emit('disconnected', gracefulLeave, undefined, 'close() called')
this.removeAllListeners()

logger.trace(getNodeIdFromPeerDescriptor(this.localPeerDescriptor) + ', '
+ getNodeIdFromPeerDescriptor(this.targetPeerDescriptor) + ' close() not stopped')
this.stopped = true
Expand Down
3 changes: 3 additions & 0 deletions packages/dht/src/connection/simulator/SimulatorConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export class SimulatorConnector {
}

public connect(targetPeerDescriptor: PeerDescriptor): ManagedConnection {
if (this.stopped) {
console.error('connect() called on stopped SimulatorConnector')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.error

}
logger.trace('connect() ' + getNodeIdFromPeerDescriptor(targetPeerDescriptor))
const nodeId = getNodeIdFromPeerDescriptor(targetPeerDescriptor)
const existingConnection = this.connectingConnections.get(nodeId)
Expand Down
27 changes: 16 additions & 11 deletions packages/dht/src/connection/websocket/AutoCertifierClientFacade.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
AutoCertifierClient,
HasSessionRequest,
HasSessionResponse,
HasSessionResponse,
CertifiedSubdomain,
SERVICE_ID as AUTO_CERTIFIER_SERVICE_ID,
HasSession
} from '@streamr/autocertifier-client'
import { ListeningRpcCommunicator } from '../../transport/ListeningRpcCommunicator'
import { Logger, waitForEvent3 } from '@streamr/utils'
import { ITransport } from '../../transport/ITransport'
import { Logger, withTimeout } from '@streamr/utils'
import { ITransport } from '../../transport/ITransport'

const START_TIMEOUT = 60 * 1000

Expand All @@ -20,14 +20,14 @@ const defaultAutoCertifierClientFactory = (
) => new AutoCertifierClient(
configFile,
wsServerPort,
autoCertifierUrl,
autoCertifierUrl,
(_serviceId: string, rpcMethodName: string, method: HasSession) => {
autoCertifierRpcCommunicator.registerRpcMethod(
HasSessionRequest,
HasSessionResponse,
rpcMethodName,
method
)
)
}
)

Expand All @@ -36,7 +36,6 @@ export interface IAutoCertifierClient {
stop(): void
on(eventName: string, cb: (subdomain: CertifiedSubdomain) => void): void
}

interface AutoCertifierClientFacadeConfig {
url: string
configFile: string
Expand All @@ -57,12 +56,13 @@ export class AutoCertifierClientFacade {
private readonly rpcCommunicator: ListeningRpcCommunicator
private readonly setHost: (host: string) => void
private readonly updateCertificate: (certificate: string, privateKey: string) => void
private abortController = new AbortController()

constructor(config: AutoCertifierClientFacadeConfig) {
this.setHost = config.setHost
this.updateCertificate = config.updateCertificate
this.rpcCommunicator = new ListeningRpcCommunicator(AUTO_CERTIFIER_SERVICE_ID, config.transport)
this.autoCertifierClient = config.createClientFactory ? config.createClientFactory()
this.autoCertifierClient = config.createClientFactory ? config.createClientFactory()
: defaultAutoCertifierClientFactory(
config.configFile,
config.url,
Expand All @@ -77,13 +77,18 @@ export class AutoCertifierClientFacade {
this.updateCertificate(subdomain.certificate, subdomain.privateKey)
logger.trace(`Updated certificate`)
})
await Promise.all([
waitForEvent3(this.autoCertifierClient as any, 'updatedCertificate', START_TIMEOUT),
this.autoCertifierClient.start()
])

// waiting for 'updatedCertificate' event is not needed here because
// all paths of this.autoCertifierClient.start() will block until 'updatedCertificate'
// event is emitted or an exception is thrown

await withTimeout(this.autoCertifierClient.start(), START_TIMEOUT,
'AutoCertifierClient.start() timed out', this.abortController.signal)

}

stop(): void {
this.abortController.abort()
this.autoCertifierClient.stop()
this.rpcCommunicator.destroy()
}
Expand Down
12 changes: 7 additions & 5 deletions packages/dht/src/connection/websocket/WebsocketConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class WebsocketConnector {
})
}

public async autoCertify(): Promise<void> {
public async startAutocertifierClient(): Promise<void> {
this.autoCertifierClient = new AutoCertifierClientFacade({
configFile: this.autoCertifierConfigFile,
transport: this.autoCertifierTransport,
Expand All @@ -144,7 +144,7 @@ export class WebsocketConnector {
setHost: (hostName: string) => this.setHost(hostName),
updateCertificate: (certificate: string, privateKey: string) => this.websocketServer!.updateCertificate(certificate, privateKey)
})
logger.trace(`AutoCertifying subdomain...`)
logger.trace(`Starting autocertifier client...`)
await this.autoCertifierClient.start()
}

Expand Down Expand Up @@ -334,10 +334,12 @@ export class WebsocketConnector {

public async destroy(): Promise<void> {
this.abortController.abort()
this.rpcCommunicator.destroy()

const requests = Array.from(this.ongoingConnectRequests.values())
await Promise.allSettled(requests.map((conn) => conn.close(false)))
if (this.autoCertifierClient) {
await this.autoCertifierClient.stop()
}

this.rpcCommunicator.destroy()

const attempts = Array.from(this.connectingConnections.values())
await Promise.allSettled(attempts.map((conn) => conn.close(false)))
Expand Down
5 changes: 4 additions & 1 deletion packages/dht/src/dht/DhtNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface DhtNodeOptions {
storageRedundancyFactor?: number

transport?: ITransport
stopGivenTransport?: boolean
peerDescriptor?: PeerDescriptor
entryPoints?: PeerDescriptor[]
websocketHost?: string
Expand Down Expand Up @@ -139,6 +140,7 @@ export class DhtNode extends EventEmitter<Events> implements ITransport {
private readonly config: StrictDhtNodeOptions
private rpcCommunicator?: RoutingRpcCommunicator
private transport?: ITransport
private stopGivenTransport = false
private localPeerDescriptor?: PeerDescriptor
public router?: Router
private storeManager?: StoreManager
Expand Down Expand Up @@ -190,6 +192,7 @@ export class DhtNode extends EventEmitter<Events> implements ITransport {
// If transport is given, do not create a ConnectionManager
if (this.config.transport) {
this.transport = this.config.transport
this.stopGivenTransport = this.config.stopGivenTransport ?? false
this.localPeerDescriptor = this.transport.getLocalPeerDescriptor()
if (this.config.transport instanceof ConnectionManager) {
this.connectionManager = this.config.transport
Expand Down Expand Up @@ -572,7 +575,7 @@ export class DhtNode extends EventEmitter<Events> implements ITransport {
this.router!.stop()
this.recursiveOperationManager!.stop()
this.peerDiscovery!.stop()
if (this.config.transport === undefined) {
if (this.config.transport === undefined || this.stopGivenTransport) {
// if the transport was not given in config, the instance was created in start() and
// this component is responsible for stopping it
await this.transport!.stop()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class RecursiveOperationManager implements IRecursiveOperationManager {
[() => this.doRouteRequest(routeMessage, excludedPeer)],
[[session, 'completed']],
// TODO use config option or named constant?
15000
15003
)
} catch (err) {
logger.debug(`doRouteRequest failed with error ${err}`)
Expand Down Expand Up @@ -202,7 +202,7 @@ export class RecursiveOperationManager implements IRecursiveOperationManager {
.doSendResponse(routingPath, closestNodes, dataEntries, noCloserNodesFound)
} else {
// TODO use config option or named constant?
const remoteCommunicator = new ListeningRpcCommunicator(serviceId, this.sessionTransport, { rpcRequestTimeout: 15000 })
const remoteCommunicator = new ListeningRpcCommunicator(serviceId, this.sessionTransport, { rpcRequestTimeout: 15007 })
const rpcRemote = new RecursiveOperationSessionRpcRemote(
this.localPeerDescriptor,
targetPeerDescriptor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class RecursiveOperationSession extends EventEmitter<RecursiveOperationSe
})
this.operation = config.operation
this.rpcCommunicator = new ListeningRpcCommunicator(this.serviceId, this.transport, {
rpcRequestTimeout: 15000 // TODO use config option or named constant?
rpcRequestTimeout: 15001 // TODO use config option or named constant?
})
this.registerLocalRpcMethods()
}
Expand Down
13 changes: 8 additions & 5 deletions packages/dht/src/proto/google/protobuf/any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ import { MessageType } from "@protobuf-ts/runtime";
* foo = any.unpack(Foo.class);
* }
*
* Example 3: Pack and unpack a message in Python.
* Example 3: Pack and unpack a message in Python.
*
* foo = Foo(...)
* any = Any()
Expand All @@ -85,13 +85,16 @@ import { MessageType } from "@protobuf-ts/runtime";
* any.Unpack(foo)
* ...
*
* Example 4: Pack and unpack a message in Go
* Example 4: Pack and unpack a message in Go
*
* foo := &pb.Foo{...}
* any, err := ptypes.MarshalAny(foo)
* any, err := anypb.New(foo)
* if err != nil {
* ...
* }
* ...
* foo := &pb.Foo{}
* if err := ptypes.UnmarshalAny(any, foo); err != nil {
* if err := any.UnmarshalTo(foo); err != nil {
* ...
* }
*
Expand All @@ -103,7 +106,7 @@ import { MessageType } from "@protobuf-ts/runtime";
*
*
* JSON
* ====
*
* The JSON representation of an `Any` value uses the regular
* representation of the deserialized, embedded message, with an
* additional field `@type` which contains the type URL. Example:
Expand Down
1 change: 0 additions & 1 deletion packages/dht/src/proto/google/protobuf/empty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { MessageType } from "@protobuf-ts/runtime";
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
* }
*
* The JSON representation for `Empty` is empty JSON object `{}`.
*
* @generated from protobuf message google.protobuf.Empty
*/
Expand Down
11 changes: 10 additions & 1 deletion packages/dht/src/proto/google/protobuf/timestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ import { MessageType } from "@protobuf-ts/runtime";
* .setNanos((int) ((millis % 1000) * 1000000)).build();
*
*
* Example 5: Compute Timestamp from current time in Python.
* Example 5: Compute Timestamp from Java `Instant.now()`.
*
* Instant now = Instant.now();
*
* Timestamp timestamp =
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
* .setNanos(now.getNano()).build();
*
*
* Example 6: Compute Timestamp from current time in Python.
*
* timestamp = Timestamp()
* timestamp.GetCurrentTime()
Expand Down
11 changes: 5 additions & 6 deletions packages/dht/src/proto/packages/dht/protos/DhtRpc.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import type { ExternalStoreDataRequest } from "./DhtRpc";
import type { ExternalFindDataResponse } from "./DhtRpc";
import type { ExternalFindDataRequest } from "./DhtRpc";
import { ConnectionLockRpc } from "./DhtRpc";
import type { DisconnectNoticeResponse } from "./DhtRpc";
import type { DisconnectNotice } from "./DhtRpc";
import type { UnlockRequest } from "./DhtRpc";
import type { LockResponse } from "./DhtRpc";
Expand Down Expand Up @@ -314,9 +313,9 @@ export interface IConnectionLockRpcClient {
*/
unlockRequest(input: UnlockRequest, options?: RpcOptions): UnaryCall<UnlockRequest, Empty>;
/**
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (dht.DisconnectNoticeResponse);
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (google.protobuf.Empty);
*/
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, DisconnectNoticeResponse>;
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, Empty>;
}
/**
* @generated from protobuf service dht.ConnectionLockRpc
Expand All @@ -342,11 +341,11 @@ export class ConnectionLockRpcClient implements IConnectionLockRpcClient, Servic
return stackIntercept<UnlockRequest, Empty>("unary", this._transport, method, opt, input);
}
/**
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (dht.DisconnectNoticeResponse);
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (google.protobuf.Empty);
*/
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, DisconnectNoticeResponse> {
gracefulDisconnect(input: DisconnectNotice, options?: RpcOptions): UnaryCall<DisconnectNotice, Empty> {
const method = this.methods[2], opt = this._transport.mergeOptions(options);
return stackIntercept<DisconnectNotice, DisconnectNoticeResponse>("unary", this._transport, method, opt, input);
return stackIntercept<DisconnectNotice, Empty>("unary", this._transport, method, opt, input);
}
}
/**
Expand Down
5 changes: 2 additions & 3 deletions packages/dht/src/proto/packages/dht/protos/DhtRpc.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ExternalStoreDataResponse } from "./DhtRpc";
import { ExternalStoreDataRequest } from "./DhtRpc";
import { ExternalFindDataResponse } from "./DhtRpc";
import { ExternalFindDataRequest } from "./DhtRpc";
import { DisconnectNoticeResponse } from "./DhtRpc";
import { DisconnectNotice } from "./DhtRpc";
import { UnlockRequest } from "./DhtRpc";
import { LockResponse } from "./DhtRpc";
Expand Down Expand Up @@ -133,9 +132,9 @@ export interface IConnectionLockRpc<T = ServerCallContext> {
*/
unlockRequest(request: UnlockRequest, context: T): Promise<Empty>;
/**
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (dht.DisconnectNoticeResponse);
* @generated from protobuf rpc: gracefulDisconnect(dht.DisconnectNotice) returns (google.protobuf.Empty);
*/
gracefulDisconnect(request: DisconnectNotice, context: T): Promise<DisconnectNoticeResponse>;
gracefulDisconnect(request: DisconnectNotice, context: T): Promise<Empty>;
}
/**
* @generated from protobuf service dht.ExternalApiRpc
Expand Down
Loading
Loading