Skip to content

Commit

Permalink
test: Decrease webpack aggregate timeout for ComponentThemeLiveReload…
Browse files Browse the repository at this point in the history
…IT (#12945)

On deletion of parent theme component css, webpack compilation
frequently fails due to an unexpected change notification for
theme-app-theme.generated.js (together with the file deletion)
that prevents theme regeneration.
Decreasing aggregate timeout seems to prevent that situation.
  • Loading branch information
mcollovati authored Feb 8, 2022
1 parent 4423980 commit 719a8a6
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
Expand Down Expand Up @@ -100,11 +99,17 @@ public void cleanUp() {
}
}

// ignored until resolved. See issue 11928
@Test
@Ignore
public void webpackLiveReload_newComponentStylesCreatedAndDeleted_stylesUpdatedOnFly() {
open();

/*
* Access browser logs in order to clear them to avoid to check entries
* from a previous run if the test is flaky due to webpack file change
* detection during parent css deletion
*/
getLogEntries(java.util.logging.Level.ALL);

Assert.assertFalse(
"Border radius for themed component is not expected before "
+ "applying the styles",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* This file contains project specific customizations for the webpack build.
* It is autogenerated if it didn't exist or if it was made for an older
* incompatible version.
*
* Defaults are provided in an autogenerated webpack.generated.js file and used by this file.
* The webpack.generated.js file is overwritten on each build and no customization can be done there.
*/
const merge = require('webpack-merge');
const flowDefaults = require('./webpack.generated.js');

/**
* To change the webpack config, add a new configuration object in
* the merge arguments below:
*/
module.exports = merge(flowDefaults,
// Decrease aggregate timeout to avoid random duplicated
// theme-app-theme.generated.js file changes notification
// that makes compilation fail when deleting parent theme component css.
// see https://github.com/vaadin/flow/issues/11928#issuecomment-1031146480
{
watchOptions: {
aggregateTimeout: 5
}
}
// Override default configuration
// {
// mode: 'development',
// devtool: 'inline-source-map',
// },

// Add a custom plugin
// (install the plugin with `npm install --save-dev webpack-bundle-analyzer`)
// {
// plugins: [
// new require('webpack-bundle-analyzer').BundleAnalyzerPlugin({
// analyzerMode: 'static'
// })
// ]
// },
);

0 comments on commit 719a8a6

Please sign in to comment.