only shut down once
This commit is contained in:
parent
e79a118ab6
commit
32755f5475
@ -220,6 +220,7 @@ export class GlobalTestState {
|
||||
testDir: string;
|
||||
procs: ProcessWrapper[];
|
||||
servers: http.Server[];
|
||||
inShutdown: false;
|
||||
constructor(params: GlobalTestParams) {
|
||||
this.testDir = params.testDir;
|
||||
this.procs = [];
|
||||
@ -307,8 +308,11 @@ export class GlobalTestState {
|
||||
return procWrap;
|
||||
}
|
||||
|
||||
async terminate(): Promise<void> {
|
||||
console.log("terminating");
|
||||
async shutdown(): Promise<void> {
|
||||
if (this.inShutdown) {
|
||||
return;
|
||||
}
|
||||
console.log("shutting down");
|
||||
for (const s of this.servers) {
|
||||
s.close();
|
||||
s.removeAllListeners();
|
||||
@ -892,7 +896,7 @@ export function runTest(testMain: (gc: GlobalTestState) => Promise<void>) {
|
||||
console.log("test logs and config can be found under", gc.testDir);
|
||||
console.log("keeping test environment running");
|
||||
} else {
|
||||
await gc.terminate();
|
||||
await gc.shutdown();
|
||||
console.log("test logs and config can be found under", gc.testDir);
|
||||
process.exit(ret);
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ export const codecForCheckPaymentUnpaidResponse = (): codec.Codec<
|
||||
.makeCodecForObject<CheckPaymentUnpaidResponse>()
|
||||
.property("order_status", codec.makeCodecForConstString("unpaid"))
|
||||
.property("taler_pay_uri", codec.codecForString)
|
||||
.property("order_status_url", codec.codecForString)
|
||||
.property(
|
||||
"already_paid_order_id",
|
||||
codec.makeCodecOptional(codec.codecForString),
|
||||
@ -161,6 +162,8 @@ export interface CheckPaymentUnpaidResponse {
|
||||
// URI that the wallet must process to complete the payment.
|
||||
taler_pay_uri: string;
|
||||
|
||||
order_status_url: string;
|
||||
|
||||
// Alternative order ID which was paid for already in the same session.
|
||||
// Only given if the same product was purchased before in the same session.
|
||||
already_paid_order_id?: string;
|
||||
|
@ -137,5 +137,5 @@ runTest(async (t: GlobalTestState) => {
|
||||
|
||||
t.assertTrue(orderStatus.order_status === "paid");
|
||||
|
||||
await t.terminate();
|
||||
await t.shutdown();
|
||||
});
|
||||
|
@ -76,5 +76,5 @@ runTest(async (t: GlobalTestState) => {
|
||||
|
||||
t.assertTrue(orderStatus.order_status === "paid");
|
||||
|
||||
await t.terminate();
|
||||
await t.shutdown();
|
||||
});
|
||||
|
@ -64,5 +64,5 @@ runTest(async (t: GlobalTestState) => {
|
||||
const balResp = walletTypes.codecForBalancesResponse().decode(balApiResp.result);
|
||||
t.assertAmountEquals("TESTKUDOS:9.72", balResp.balances[0].available)
|
||||
|
||||
await t.terminate();
|
||||
await t.shutdown();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user