Skip to content

Commit 3191ddb

Browse files
committed
chore: Remove benchmark logic
1 parent cfc53fb commit 3191ddb

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

site/src/pages/TemplateSettingsPage/TemplateSchedulePage/TemplateSchedulePage.test.tsx

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/*eslint eslint-comments/disable-enable-pair: error -- Remove after bottlenecks or causes of timeouts for testing have been figured out */
21
import { screen, waitFor } from "@testing-library/react";
32
import userEvent from "@testing-library/user-event";
43
import * as API from "api/api";
@@ -46,55 +45,44 @@ type FillAndSubmitConfig = {
4645
: never]?: TemplateScheduleFormValues[Key] | undefined;
4746
};
4847

49-
/*eslint-disable no-console -- Start benchmarks */
5048
const fillAndSubmitForm = async ({
5149
default_ttl_ms,
5250
max_ttl_ms,
5351
failure_ttl_ms,
5452
time_til_dormant_ms,
5553
time_til_dormant_autodelete_ms,
5654
}: FillAndSubmitConfig) => {
57-
console.time("form - full function");
5855
const user = userEvent.setup();
5956

60-
console.time("form - ttl");
6157
if (default_ttl_ms) {
6258
const defaultTtlField = await screen.findByLabelText(
6359
"Default autostop (hours)",
6460
);
6561
await user.clear(defaultTtlField);
6662
await user.type(defaultTtlField, default_ttl_ms.toString());
6763
}
68-
console.timeEnd("form - ttl");
6964

70-
console.time("form - max_ttl");
7165
if (max_ttl_ms) {
7266
const maxTtlField = await screen.findByLabelText("Max lifetime (hours)");
7367

7468
await user.clear(maxTtlField);
7569
await user.type(maxTtlField, max_ttl_ms.toString());
7670
}
77-
console.timeEnd("form - max_ttl");
7871

79-
console.time("form - failure_ttl");
8072
if (failure_ttl_ms) {
8173
const failureTtlField = screen.getByRole("checkbox", {
8274
name: /Failure Cleanup/i,
8375
});
8476
await user.type(failureTtlField, failure_ttl_ms.toString());
8577
}
86-
console.timeEnd("form - failure_ttl");
8778

88-
console.time("form - dormant");
8979
if (time_til_dormant_ms) {
9080
const inactivityTtlField = screen.getByRole("checkbox", {
9181
name: /Dormancy Threshold/i,
9282
});
9383
await user.type(inactivityTtlField, time_til_dormant_ms.toString());
9484
}
95-
console.timeEnd("form - dormant");
9685

97-
console.time("form - auto-delete");
9886
if (time_til_dormant_autodelete_ms) {
9987
const dormancyAutoDeletionField = screen.getByRole("checkbox", {
10088
name: /Dormancy Auto-Deletion/i,
@@ -104,24 +92,16 @@ const fillAndSubmitForm = async ({
10492
time_til_dormant_autodelete_ms.toString(),
10593
);
10694
}
107-
console.timeEnd("form - auto-delete");
10895

109-
console.time("form - submit");
11096
const submitButton = await screen.findByText(
11197
FooterFormLanguage.defaultSubmitLabel,
11298
);
11399
await user.click(submitButton);
114-
console.timeEnd("form - submit");
115100

116-
console.time("form - confirm");
117101
// User needs to confirm dormancy and auto-deletion fields.
118102
const confirmButton = await screen.findByTestId("confirm-button");
119103
await user.click(confirmButton);
120-
console.timeEnd("form - confirm");
121-
122-
console.timeEnd("form - full function");
123104
};
124-
/*eslint-enable no-console -- End benchmarks */
125105

126106
describe("TemplateSchedulePage", () => {
127107
beforeEach(() => {
@@ -142,7 +122,7 @@ describe("TemplateSchedulePage", () => {
142122

143123
await fillAndSubmitForm(validFormValues);
144124
await waitFor(() => expect(API.updateTemplateMeta).toBeCalledTimes(1));
145-
}, 15_000);
125+
});
146126

147127
test("default and max ttl is converted to and from hours", async () => {
148128
await renderTemplateSchedulePage();

0 commit comments

Comments
 (0)