Skip to content

Commit

Permalink
[Entity Analytics] Sort asset criticality by @timestamp by default …
Browse files Browse the repository at this point in the history
…+ unskip serverless tests (elastic#200712)

## Summary

Closes elastic#189067

These asset criticality tests were failing in serverless because it
seems queries without a specified sort order behave differently in
serverless vs ESS.

I have made it so that asset criticality sorts by timestamp by default,
this makes serverless the same as ESS.

I have backported to 8.16 as I think the more tests that run, the
better.
  • Loading branch information
hop-dev authored and paulinashakirova committed Nov 26, 2024
1 parent bdbf314 commit e0e9c64
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class AssetCriticalityDataClient {
query,
size = DEFAULT_CRITICALITY_RESPONSE_SIZE,
from,
sort,
sort = ['@timestamp'], // without a default sort order the results are not deterministic which makes testing hard
}: {
query: ESFilter;
size?: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default ({ getService }: FtrProviderContext) => {

const createRecords = () => createAssetCriticalityRecords(records, es);

it('@skipInServerless should return the first 10 asset criticality records if no args provided', async () => {
it(' should return the first 10 asset criticality records if no args provided', async () => {
await createRecords();

const { body } = await assetCriticalityRoutes.list();
Expand Down Expand Up @@ -259,7 +259,7 @@ export default ({ getService }: FtrProviderContext) => {
);
});

it('@skipInServerless should only return 1 asset criticality record if per_page=1', async () => {
it('should only return 1 asset criticality record if per_page=1', async () => {
await createRecords();

const { body } = await assetCriticalityRoutes.list({ per_page: 1 });
Expand All @@ -273,7 +273,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(body.records[0].id_value).to.eql(records[0].id_value);
});

it('@skipInServerless should return the next 10 asset criticality records if page=2', async () => {
it('should return the next 10 asset criticality records if page=2', async () => {
await createRecords();

const { body } = await assetCriticalityRoutes.list({ page: 2 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default ({ getService }: FtrProviderContext): void => {
);
});

it('@skipInServerlessMKI @skipInServerless starts the latest transform', async () => {
it('@skipInServerlessMKI starts the latest transform', async () => {
// Transform states that indicate the transform is running happily
const TRANSFORM_STARTED_STATES = ['started', 'indexing'];

Expand Down

0 comments on commit e0e9c64

Please sign in to comment.