test: fix flaky integration tests for compress command (#10371)

Co-authored-by: Taneja Hriday <hridayt@google.com>
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
hritan
2025-10-03 19:42:28 +00:00
committed by GitHub
parent c9eb58e122
commit f2308dba28
2 changed files with 6 additions and 11 deletions

View File

@@ -99,12 +99,6 @@ describe('Interactive Mode', () => {
await new Promise((resolve) => setTimeout(resolve, 100));
await type(ptyProcess, '\r');
const foundEvent = await rig.waitForTelemetryEvent(
'chat_compression',
90000,
);
expect(foundEvent).toBe(true);
const compressionFailed = await rig.waitForText(
'compression was not beneficial',
25000,

View File

@@ -140,13 +140,14 @@ describe('replace', () => {
it('should insert a multi-line block of text', async () => {
const rig = new TestRig();
await rig.setup('should insert a multi-line block of text');
const fileName = 'insert_block.js';
const originalContent = 'function hello() {\n // INSERT_CODE_HERE\n}';
const newBlock = "console.log('hello');\n console.log('world');";
const expectedContent = `function hello() {\n ${newBlock}\n}`;
const fileName = 'insert_block.txt';
const originalContent = 'Line A\n<INSERT_TEXT_HERE>\nLine C';
const newBlock = 'First line\nSecond line\nThird line';
const expectedContent =
'Line A\nFirst line\nSecond line\nThird line\nLine C';
rig.createFile(fileName, originalContent);
const prompt = `In ${fileName}, replace "// INSERT_CODE_HERE" with:\n${newBlock}`;
const prompt = `In ${fileName}, replace "<INSERT_TEXT_HERE>" with:\n${newBlock}`;
const result = await rig.run(prompt);
const foundToolCall = await rig.waitForToolCall('replace');